Skip to content

Conversation

@hyowon612
Copy link
Collaborator

@hyowon612 hyowon612 commented Mar 22, 2025

⭐️Issue


🌟Motivation

DTO-Entity 분리 및 최신 컨벤션 반영


🌟Key Changes

  • Auth/Keyword/NovelReview에 대해 DTO와 Entity를 분리하고 최신 네이밍을 적용했습니다.
  • FeedEdit/NovelDetailFeed/NovelReview에 대해 VM에서 처리할 필요가 없는 로직을 VC로 옮겼습니다.

🌟Simulation

X

🌟To Reviewer

X

🌟Reference

X

@hyowon612 hyowon612 self-assigned this Mar 22, 2025
@hyowon612 hyowon612 changed the title Refactor/#510 [Refactor] #510 - DTO-Entity 분리 및 최신 컨벤션 반영 Mar 22, 2025
@hyowon612 hyowon612 marked this pull request as ready for review March 24, 2025 09:47
Copy link
Member

@ena-isme ena-isme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 :)

Copy link
Member

@Guryss Guryss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니당 몇가지 제안한 것들만 확인해주세욧 !

Copy link
Member

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?
Copy link
Member

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]
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
owner.navigationController?.popViewController(animated: true)
owner.popToLastViewController()

Copy link
Contributor

@Naknakk Naknakk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

구리스 제안이 좋네용 저두 Entity는 서버에서 준 데이터를 우리가 만든 모델로 바꿔주는게 베스트라구 생각합니다!!

Copy link
Member

@Guryss Guryss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영해주셔서 검사합니당!
리뷰 하나 더 남겼으니 확인 부탁드려용

Comment on lines +22 to +25
let dateFormatter = DateFormatter().then {
$0.dateFormat = "yyyy-MM-dd"
$0.timeZone = TimeZone(identifier: "ko_KR")
}
Copy link
Member

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) }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] DTO-Entity 분리 및 최신 컨벤션 반영

5 participants