Skip to content

Commit

Permalink
[Fix] Place Entity 수정 - #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin0331 committed Feb 3, 2025
1 parent b45a308 commit 806d2c9
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Whidy-iOS/Repository/Entity/Place.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,42 @@
import Foundation
import CoreData

struct Place: Identifiable {
struct Place: Identifiable, Equatable {
let id: Int
let name: String
var name: String
let address: String
let latitude: Double
let longitude: Double
let beveragePrice: Int?
let reviewScore: Double?
let placeType: PlaceType

enum PlaceType: String {
enum PlaceType: String, Equatable {
case studyCafe = "STUDY_CAFE"
case generalCafe = "GENERAL_CAFE"
case franchiseCafe = "FRANCHISE_CAFE"
case freePicture = "FREE_PICTURE"
case freeStudySpace = "FREE_STUDY_SPACE"
case freeClothesRental = "FREE_CLOTHES_RENTAL"
}

static func == (lhs: Place, rhs: Place) -> Bool {
return lhs.id == rhs.id
}
}

extension Place {
init() {
self.id = .init()
self.name = .init()
self.address = .init()
self.latitude = .init()
self.longitude = .init()
self.beveragePrice = .init()
self.reviewScore = .init()
self.placeType = .generalCafe
}

init(dto: PlaceDTO) {
self.id = dto.id
self.name = dto.name
Expand Down

0 comments on commit 806d2c9

Please sign in to comment.