From 6a2da5076ae71b6e78e44126bf0f7c18a1297214 Mon Sep 17 00:00:00 2001 From: doyeonk429 <80318425+doyeonk429@users.noreply.github.com> Date: Wed, 29 Oct 2025 00:52:30 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[BOOK-379]=20feat:=20data=20layer=20?= =?UTF-8?q?=EB=8B=A8=EC=97=90=EC=84=9C=20optional=EB=A1=9C=20rq/rsp=20?= =?UTF-8?q?=EB=91=98=20=EB=8B=A4=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20DTO=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BKData/Sources/DTO/Request/InsertRecordRequestDTO.swift | 4 ++-- .../BKData/Sources/DTO/Response/DetailRecordResponseDTO.swift | 2 +- .../BKData/Sources/DTO/Response/InsertRecordResponseDTO.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Projects/BKData/Sources/DTO/Request/InsertRecordRequestDTO.swift b/src/Projects/BKData/Sources/DTO/Request/InsertRecordRequestDTO.swift index ed094d72..6b5d6efc 100644 --- a/src/Projects/BKData/Sources/DTO/Request/InsertRecordRequestDTO.swift +++ b/src/Projects/BKData/Sources/DTO/Request/InsertRecordRequestDTO.swift @@ -6,13 +6,13 @@ import Foundation struct InsertRecordRequestDTO: Encodable { let pageNumber: Int let quote: String - let review: String + let review: String? let emotionTags: [String] init( pageNumber: Int, quote: String, - review: String, + review: String?, emotionTags: [String] ) { self.pageNumber = pageNumber diff --git a/src/Projects/BKData/Sources/DTO/Response/DetailRecordResponseDTO.swift b/src/Projects/BKData/Sources/DTO/Response/DetailRecordResponseDTO.swift index d3068f28..d0303ad5 100644 --- a/src/Projects/BKData/Sources/DTO/Response/DetailRecordResponseDTO.swift +++ b/src/Projects/BKData/Sources/DTO/Response/DetailRecordResponseDTO.swift @@ -8,7 +8,7 @@ public struct DetailRecordResponseDTO: Decodable { public let userBookId: String public let pageNumber: Int public let quote: String - public let review: String + public let review: String? public let emotionTags: [Emotion] public let createdAt: String public let updatedAt: String diff --git a/src/Projects/BKData/Sources/DTO/Response/InsertRecordResponseDTO.swift b/src/Projects/BKData/Sources/DTO/Response/InsertRecordResponseDTO.swift index 02982775..ec86c90a 100644 --- a/src/Projects/BKData/Sources/DTO/Response/InsertRecordResponseDTO.swift +++ b/src/Projects/BKData/Sources/DTO/Response/InsertRecordResponseDTO.swift @@ -8,7 +8,7 @@ public struct InsertRecordResponseDTO: Decodable { let userBookId: String let pageNumber: Int let quote: String - let review: String + let review: String? let emotionTags: [Emotion] let createdAt: String let updatedAt: String From 2ad2262cc112b4b30436f318fee45680efb9364b Mon Sep 17 00:00:00 2001 From: doyeonk429 <80318425+doyeonk429@users.noreply.github.com> Date: Wed, 29 Oct 2025 00:52:44 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[BOOK-379]=20feat:=20entity,=20vo=20level?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Projects/BKDomain/Sources/Entity/RecordInfo.swift | 4 ++-- src/Projects/BKDomain/Sources/VO/RecordDetails/RecordVO.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Projects/BKDomain/Sources/Entity/RecordInfo.swift b/src/Projects/BKDomain/Sources/Entity/RecordInfo.swift index 3319f668..1ce26dd6 100644 --- a/src/Projects/BKDomain/Sources/Entity/RecordInfo.swift +++ b/src/Projects/BKDomain/Sources/Entity/RecordInfo.swift @@ -7,7 +7,7 @@ public struct RecordInfo: Decodable, Equatable { public let bookId: String public let pageNumber: Int public let quote: String - public let review: String + public let review: String? public let emotionTags: [Emotion] public let createdAt: Date public let updatedAt: Date? @@ -21,7 +21,7 @@ public struct RecordInfo: Decodable, Equatable { bookId: String, pageNumber: Int, quote: String, - review: String, + review: String?, emotionTags: [Emotion], createdAt: Date, updatedAt: Date?, diff --git a/src/Projects/BKDomain/Sources/VO/RecordDetails/RecordVO.swift b/src/Projects/BKDomain/Sources/VO/RecordDetails/RecordVO.swift index c51aee05..e43607d4 100644 --- a/src/Projects/BKDomain/Sources/VO/RecordDetails/RecordVO.swift +++ b/src/Projects/BKDomain/Sources/VO/RecordDetails/RecordVO.swift @@ -5,13 +5,13 @@ import Foundation public struct RecordVO { public let pageNumber: Int public let quote: String - public let review: String + public let review: String? public let emotionTags: [String] public init( pageNumber: Int, quote: String, - review: String, + review: String?, emotionTags: [String] ) { self.pageNumber = pageNumber From bc3f23518f6468e600e1838dd17cf42971e67a26 Mon Sep 17 00:00:00 2001 From: doyeonk429 <80318425+doyeonk429@users.noreply.github.com> Date: Wed, 29 Oct 2025 00:53:07 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[BOOK-379]=20feat:=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=EC=97=90=EC=84=9C=20optional=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainFlow/NoteCompletion/View/AppreciationResultView.swift | 2 +- .../MainFlow/NoteCompletion/View/NoteCompletionView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift index fcbfb45a..af2e3aa2 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift @@ -139,7 +139,7 @@ final class AppreciationResultView: BaseView { func apply( emotion: EmotionIcon, creationDate: Date, - appreciation: String + appreciation: String = "" ) { emotionIcon.image = emotion.icon emotionLabel.setText(text: emotion.rawValue) diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionView.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionView.swift index ffd6aa59..a8383508 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionView.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionView.swift @@ -46,7 +46,7 @@ final class NoteCompletionView: BaseView { appreciationResultView.apply( emotion: EmotionIcon.from(emotion: recordInfo.emotionTags.first ?? .joy), creationDate: recordInfo.createdAt, - appreciation: recordInfo.review + appreciation: recordInfo.review ?? "" ) } From 73b45808f155cc37f016a43aba788f25a85a58b4 Mon Sep 17 00:00:00 2001 From: doyeonk429 <80318425+doyeonk429@users.noreply.github.com> Date: Wed, 29 Oct 2025 00:53:28 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[BOOK-379]=20feat:=20=EB=85=B8=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=ED=99=94=EB=A9=B4=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B9=88=EA=B0=92=20->=20=EB=82=B4=EC=9A=A9=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20=EB=82=B4=EC=9A=A9=20->=20=EB=B9=88=EA=B0=92?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B0=94=EA=BE=B8=EB=8A=94=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91=20=EC=A0=95=EC=83=81=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/MainFlow/Note/ViewModel/NoteForm.swift | 2 +- .../Sources/MainFlow/NoteEdit/View/NoteEditView.swift | 7 ++++++- .../MainFlow/NoteEdit/ViewModel/NoteEditViewModel.swift | 7 +++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Projects/BKPresentation/Sources/MainFlow/Note/ViewModel/NoteForm.swift b/src/Projects/BKPresentation/Sources/MainFlow/Note/ViewModel/NoteForm.swift index 3334967e..560fe43d 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/Note/ViewModel/NoteForm.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/Note/ViewModel/NoteForm.swift @@ -6,7 +6,7 @@ struct NoteForm: Equatable { let page: Int let sentence: String let emotion: Emotion - let appreciation: String + let appreciation: String? } extension NoteForm { diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift index 3b8bef5e..82e3890a 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift @@ -248,7 +248,12 @@ final class NoteEditView: BaseView { pageField.setText("\(recordInfo.pageNumber)") sentenceTextView.setText(recordInfo.quote) - appreciationTextView.setText(recordInfo.review) + + if let review = recordInfo.review { + appreciationTextView.setText(review) + } else { + + } // 감정 라벨은 selectedEmotion 바인딩에서만 설정 } diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/ViewModel/NoteEditViewModel.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/ViewModel/NoteEditViewModel.swift index ceba46aa..5d69aef7 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/ViewModel/NoteEditViewModel.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/ViewModel/NoteEditViewModel.swift @@ -23,7 +23,7 @@ final class NoteEditViewModel: BaseViewModel { case errorHandled case presentEmotionEdit case emotionSelected(Emotion) - case saveButtonTapped(formData: (page: Int?, sentence: String, appreciation: String)) + case saveButtonTapped(formData: (page: Int?, sentence: String, appreciation: String?)) case patchRecordSuccessed(RecordInfo) case deleteButtonTapped case deleteRecordSuccessed @@ -95,9 +95,8 @@ final class NoteEditViewModel: BaseViewModel { case .saveButtonTapped(let formData): guard let selectedEmotion = state.selectedEmotion, let page = formData.page, - !formData.sentence.isEmpty, - !formData.appreciation.isEmpty else { - break + !formData.sentence.isEmpty else { + break } let noteForm = NoteForm( From 6481c0d8cd3afb943c764ec6ccc7f50fec324b1a Mon Sep 17 00:00:00 2001 From: doyeonk429 <80318425+doyeonk429@users.noreply.github.com> Date: Wed, 29 Oct 2025 01:15:00 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[BOOK-379]=20feat:=20=EA=B0=90=EC=83=81?= =?UTF-8?q?=ED=8F=89=20=EB=B6=80=EB=B6=84=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/AppreciationResultView.swift | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift index af2e3aa2..47f76cde 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift @@ -44,7 +44,7 @@ final class AppreciationResultView: BaseView { ) private let rootStackBackgroundView = UIView() - private let rootStack: UIStackView = { + private lazy var rootStack: UIStackView = { let stackView = UIStackView() stackView.axis = .vertical stackView.spacing = LayoutConstants.rootStackSpacing @@ -139,12 +139,22 @@ final class AppreciationResultView: BaseView { func apply( emotion: EmotionIcon, creationDate: Date, - appreciation: String = "" + appreciation: String? = "" ) { emotionIcon.image = emotion.icon emotionLabel.setText(text: emotion.rawValue) creationLabel.setText(text: creationDate.toKoreanDateString()) - appreciationLabel.setText(text: appreciation) + + if let review = appreciation, !review.isEmpty { + appreciationLabel.setText(text: review) + rootStack.spacing = LayoutConstants.rootStackSpacing + } else { + rootStack.spacing = 0 + rootStack.removeArrangedSubview(appreciationLabel) + } + + rootStack.setNeedsLayout() + rootStack.layoutIfNeeded() } } From d668529121ba2eb250a91eb3b647bf7f6b055b11 Mon Sep 17 00:00:00 2001 From: doyeonk429 <80318425+doyeonk429@users.noreply.github.com> Date: Wed, 29 Oct 2025 22:30:02 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[BOOK-379]=20feat:=20=ED=86=A0=EB=81=BC=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NoteCompletion/View/AppreciationResultView.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift index 47f76cde..613ff91a 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift @@ -148,9 +148,14 @@ final class AppreciationResultView: BaseView { if let review = appreciation, !review.isEmpty { appreciationLabel.setText(text: review) rootStack.spacing = LayoutConstants.rootStackSpacing + if !rootStack.arrangedSubviews.contains(appreciationLabel) { + rootStack.addArrangedSubview(appreciationLabel) + } } else { rootStack.spacing = 0 - rootStack.removeArrangedSubview(appreciationLabel) + if rootStack.arrangedSubviews.contains(appreciationLabel) { + rootStack.removeArrangedSubview(appreciationLabel) + } } rootStack.setNeedsLayout() From 2854f10926bde12d7937040c627eb8e72d8e4641 Mon Sep 17 00:00:00 2001 From: doyeonk429 <80318425+doyeonk429@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:47:48 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[BOOK-379]=20fix:=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/AppreciationResultView.swift | 21 +++++++------------ .../MainFlow/NoteEdit/View/NoteEditView.swift | 3 --- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift index 613ff91a..ea26209d 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift @@ -44,7 +44,7 @@ final class AppreciationResultView: BaseView { ) private let rootStackBackgroundView = UIView() - private lazy var rootStack: UIStackView = { + private let rootStack: UIStackView = { let stackView = UIStackView() stackView.axis = .vertical stackView.spacing = LayoutConstants.rootStackSpacing @@ -146,20 +146,13 @@ final class AppreciationResultView: BaseView { creationLabel.setText(text: creationDate.toKoreanDateString()) if let review = appreciation, !review.isEmpty { - appreciationLabel.setText(text: review) - rootStack.spacing = LayoutConstants.rootStackSpacing - if !rootStack.arrangedSubviews.contains(appreciationLabel) { - rootStack.addArrangedSubview(appreciationLabel) + appreciationLabel.setText(text: review) + appreciationLabel.isHidden = false + rootStack.spacing = LayoutConstants.rootStackSpacing + } else { + appreciationLabel.isHidden = true + rootStack.spacing = 0 } - } else { - rootStack.spacing = 0 - if rootStack.arrangedSubviews.contains(appreciationLabel) { - rootStack.removeArrangedSubview(appreciationLabel) - } - } - - rootStack.setNeedsLayout() - rootStack.layoutIfNeeded() } } diff --git a/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift b/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift index 82e3890a..44fbc513 100644 --- a/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift +++ b/src/Projects/BKPresentation/Sources/MainFlow/NoteEdit/View/NoteEditView.swift @@ -251,10 +251,7 @@ final class NoteEditView: BaseView { if let review = recordInfo.review { appreciationTextView.setText(review) - } else { - } - // 감정 라벨은 selectedEmotion 바인딩에서만 설정 }