33import BKDomain
44import Foundation
55
6- public struct DetailRecordResponseDTO : Decodable {
7- public let id : String
8- public let userBookId : String
9- public let pageNumber : Int
10- public let quote : String
11- public let review : String ?
12- public let emotionTags : [ Emotion ]
13- public let createdAt : String
14- public let updatedAt : String
15- public let bookTitle : String
16- public let bookPublisher : String
17- public let bookCoverImageUrl : URL
18- public let author : String
6+ struct DetailRecordResponseDTO : Decodable {
7+ let id : String
8+ let userBookId : String
9+ let pageNumber : Int ?
10+ let quote : String
11+ let review : String ?
12+ let primaryEmotion : PrimaryEmotionDTO
13+ let detailEmotions : [ DetailEmotionDTO ]
14+ let createdAt : String
15+ let updatedAt : String
16+ let bookTitle : String
17+ let bookPublisher : String
18+ let bookCoverImageUrl : URL
19+ let author : String
1920}
2021
2122extension DetailRecordResponseDTO {
@@ -26,7 +27,8 @@ extension DetailRecordResponseDTO {
2627 pageNumber: pageNumber,
2728 quote: quote,
2829 review: review,
29- emotionTags: emotionTags,
30+ primaryEmotion: primaryEmotion. toDomain ( ) ?? . other,
31+ detailEmotions: detailEmotions. map { $0. toDomain ( ) } ,
3032 createdAt: DateParser . parseISO8601 ( createdAt) ?? . distantPast,
3133 updatedAt: DateParser . parseISO8601 ( updatedAt) ,
3234 bookTitle: bookTitle,
@@ -41,11 +43,11 @@ extension DetailRecordResponseDTO {
4143public struct DetailRecordV2ResponseDTO : Decodable {
4244 public let id : String
4345 public let userBookId : String
44- public let pageNumber : Int
46+ public let pageNumber : Int ?
4547 public let quote : String
4648 public let review : String ?
4749 public let primaryEmotion : PrimaryEmotionResponseDTO
48- public let detailEmotions : [ DetailEmotionResponseDTO ? ]
50+ public let detailEmotions : [ DetailEmotionResponseDTO ]
4951 public let createdAt : String
5052 public let updatedAt : String
5153 public let bookTitle : String
@@ -62,7 +64,8 @@ extension DetailRecordV2ResponseDTO {
6264 pageNumber: pageNumber,
6365 quote: quote,
6466 review: review,
65- emotionTags: [ primaryEmotion. displayName] ,
67+ primaryEmotion: primaryEmotion. toDomain ( ) ,
68+ detailEmotions: detailEmotions. map { $0. toDomain ( ) } ,
6669 createdAt: DateParser . parseISO8601 ( createdAt) ?? . distantPast,
6770 updatedAt: DateParser . parseISO8601 ( updatedAt) ,
6871 bookTitle: bookTitle,
0 commit comments