-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor] #510 - DTO-Entity 분리 및 최신 컨벤션 반영 #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Develop
Are you sure you want to change the base?
Conversation
ena-isme
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 :)
Guryss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니당 몇가지 제안한 것들만 확인해주세욧 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W1;
파일명에 DTO 뺴주세욧
|
|
||
| struct NovelReviewEntity { | ||
| let novelTitle: String | ||
| let status: String? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W1;
작품 리뷰 status를 Enum으로 관리하는 건 어떨까요?
enum NovelReviewStatus {
case reading
case finish
case drop
}이런 느낌으로 ...
| let startDate: Date? | ||
| let endDate: Date? | ||
| let userNovelRating: Float | ||
| let attractivePoints: [String] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W1;
매력포인트 값들도 enum으로 관리해보는 게 어떨지요..?
let attractivePoints: [AttractivePointType]
enum AttractivePointType {
case world
case subject
case character
case relationship
case vibe
}| .subscribe(with: self, onNext: { owner, buttonType in | ||
| if buttonType == .left { | ||
| owner.stopEditingEvent.accept(()) | ||
| owner.navigationController?.popViewController(animated: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| owner.navigationController?.popViewController(animated: true) | |
| owner.popToLastViewController() |
| .subscribe(with: self, onNext: { owner, buttonType in | ||
| if buttonType == .left { | ||
| owner.stopReviewingEvent.accept(()) | ||
| owner.navigationController?.popViewController(animated: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| owner.navigationController?.popViewController(animated: true) | |
| owner.popToLastViewController() |
Naknakk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구리스 제안이 좋네용 저두 Entity는 서버에서 준 데이터를 우리가 만든 모델로 바꿔주는게 베스트라구 생각합니다!!
Guryss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영해주셔서 검사합니당!
리뷰 하나 더 남겼으니 확인 부탁드려용
| let dateFormatter = DateFormatter().then { | ||
| $0.dateFormat = "yyyy-MM-dd" | ||
| $0.timeZone = TimeZone(identifier: "ko_KR") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 변수를 DateFormatter 익스텐션으로 빼서 static 변수로 만드는 게 기능상 좋아보입니다!
DateFormatter는 내부적인 계산이 많이 들어가는 값이기 떄문에 static 변수로 빼서 한번만 생성되고 앱 내에서 재사용 되는 방법이 어떨까요?
extension DateFormatter {
static let dateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
formatter.timeZone = TimeZone(identifier: "ko_KR")
return formatter
}()
}func toEntity() -> NovelReviewEntity {
let formatter = DateFormatter.dateFormatter
let startDate = self.startDate.flatMap { formatter.date(from: $0) }
let endDate = self.endDate.flatMap { formatter.date(from: $0) }
}
⭐️Issue
🌟Motivation
DTO-Entity 분리 및 최신 컨벤션 반영
🌟Key Changes
🌟Simulation
X
🌟To Reviewer
X
🌟Reference
X