From 997e23375ee7065ac1e1ca7d5bedd6004efb6a98 Mon Sep 17 00:00:00 2001 From: "pikagreen@nate.com" Date: Tue, 11 Jun 2024 17:26:38 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20::=20[#598]=20SongsDom?= =?UTF-8?q?ain=20api=20=EC=B6=94=EA=B0=80=20=EB=B3=80=EA=B2=BD=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataSource/RemoteSongsDataSource.swift | 2 +- .../Interface/Entity/SongCreditsEntity.swift | 39 +++---------------- .../Interface/Entity/SongEntity.swift | 15 ++++++- .../Repository/SongsRepository.swift | 2 +- .../UseCase/FetchSongCreditsUseCase.swift | 2 +- .../RemoteSongsDataSourceImpl.swift | 6 +-- .../Repository/SongsRepositoryImpl.swift | 2 +- .../ResponseDTO/SingleSongResponseDTO.swift | 11 +++++- .../ResponseDTO/SongCreditsResponseDTO.swift | 23 ++--------- .../UseCase/FetchSongCreditsUseCaseImpl.swift | 2 +- 10 files changed, 42 insertions(+), 62 deletions(-) diff --git a/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift b/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift index ab6070c6a..75e77ac32 100644 --- a/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift +++ b/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift @@ -3,6 +3,6 @@ import RxSwift public protocol RemoteSongsDataSource { func fetchLyrics(id: String) -> Single<[LyricsEntity]> - func fetchSongCredits(id: String) -> Single + func fetchSongCredits(id: String) -> Single<[SongCreditsEntity]> func fetchNewSongs(type: NewSongGroupType, page: Int, limit: Int) -> Single<[NewSongsEntity]> } diff --git a/Projects/Domains/SongsDomain/Interface/Entity/SongCreditsEntity.swift b/Projects/Domains/SongsDomain/Interface/Entity/SongCreditsEntity.swift index 77ef6ba47..1cbab5269 100644 --- a/Projects/Domains/SongsDomain/Interface/Entity/SongCreditsEntity.swift +++ b/Projects/Domains/SongsDomain/Interface/Entity/SongCreditsEntity.swift @@ -10,40 +10,13 @@ import Foundation public struct SongCreditsEntity { public init( - vocal: [String], - featuring: [String], - original: String, - producing: [String], - lyrics: [String], - relyrics: [String], - compose: [String], - arrange: [String], - mixing: [String], - mastering: [String], - session: [String], - chorus: [String], - vocalGuide: [String], - trainer: [String] + type: String, + names: [String] ) { - self.vocal = vocal - self.featuring = featuring - self.original = original - self.producing = producing - self.lyrics = lyrics - self.relyrics = relyrics - self.compose = compose - self.arrange = arrange - self.mixing = mixing - self.mastering = mastering - self.session = session - self.chorus = chorus - self.vocalGuide = vocalGuide - self.trainer = trainer + self.type = type + self.names = names } - public let vocal, featuring: [String] - public let original: String - public let producing, lyrics, relyrics, compose: [String] - public let arrange, mixing, mastering, session: [String] - public let chorus, vocalGuide, trainer: [String] + public let type: String + public let names: [String] } diff --git a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift index 08b7c850c..ea16cbc5b 100644 --- a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift +++ b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift @@ -10,7 +10,8 @@ public struct SongEntity: Equatable { views: Int, last: Int, date: String, - isSelected: Bool = false + isSelected: Bool = false, + karaokeNumber: SongEntity.KaraokeNumber = .init(TJ: 0, KY: 0) ) { self.id = id self.title = title @@ -21,6 +22,7 @@ public struct SongEntity: Equatable { self.last = last self.date = date self.isSelected = isSelected + self.karaokeNumber = karaokeNumber } public let id, title, artist, remix: String @@ -28,8 +30,19 @@ public struct SongEntity: Equatable { public let views, last: Int public let date: String public var isSelected: Bool + public let karaokeNumber: SongEntity.KaraokeNumber public static func == (lhs: SongEntity, rhs: SongEntity) -> Bool { lhs.id == rhs.id } } + +public extension SongEntity { + struct KaraokeNumber { + public init (TJ: Int, KY: Int) { + self.TJ = TJ + self.KY = KY + } + public let TJ, KY: Int + } +} diff --git a/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift b/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift index 02d1b8b02..83b5b78d9 100644 --- a/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift +++ b/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift @@ -3,6 +3,6 @@ import RxSwift public protocol SongsRepository { func fetchLyrics(id: String) -> Single<[LyricsEntity]> - func fetchSongCredits(id: String) -> Single + func fetchSongCredits(id: String) -> Single<[SongCreditsEntity]> func fetchNewSongs(type: NewSongGroupType, page: Int, limit: Int) -> Single<[NewSongsEntity]> } diff --git a/Projects/Domains/SongsDomain/Interface/UseCase/FetchSongCreditsUseCase.swift b/Projects/Domains/SongsDomain/Interface/UseCase/FetchSongCreditsUseCase.swift index 5e09c657e..716227c6b 100644 --- a/Projects/Domains/SongsDomain/Interface/UseCase/FetchSongCreditsUseCase.swift +++ b/Projects/Domains/SongsDomain/Interface/UseCase/FetchSongCreditsUseCase.swift @@ -10,5 +10,5 @@ import Foundation import RxSwift public protocol FetchSongCreditsUseCase { - func execute(id: String) -> Single + func execute(id: String) -> Single<[SongCreditsEntity]> } diff --git a/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift b/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift index ab618e9c3..6262002ef 100644 --- a/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift +++ b/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift @@ -10,10 +10,10 @@ public final class RemoteSongsDataSourceImpl: BaseRemoteDataSource, Re .map { $0.map { $0.toDomain() }} } - public func fetchSongCredits(id: String) -> Single { + public func fetchSongCredits(id: String) -> Single<[SongCreditsEntity]> { request(.fetchCredits(id: id)) - .map(SongCreditsResponseDTO.self) - .map { $0.toDomain() } + .map([SongCreditsResponseDTO].self) + .map { $0.map { $0.toDomain() }} } public func fetchNewSongs(type: NewSongGroupType, page: Int, limit: Int) -> Single<[NewSongsEntity]> { diff --git a/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift b/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift index 66bb5fc27..f1a86058b 100644 --- a/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift +++ b/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift @@ -14,7 +14,7 @@ public final class SongsRepositoryImpl: SongsRepository { remoteSongsDataSource.fetchLyrics(id: id) } - public func fetchSongCredits(id: String) -> Single { + public func fetchSongCredits(id: String) -> Single<[SongCreditsEntity]> { remoteSongsDataSource.fetchSongCredits(id: id) } diff --git a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift index 5088d85aa..e2a9b2e74 100644 --- a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift +++ b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift @@ -14,10 +14,18 @@ public struct SingleSongResponseDTO: Decodable { public let songID, title: String public let artists: [String] public let date, views, likes: Int + public let karaokeNumber: SingleSongResponseDTO.KaraokeNumber? enum CodingKeys: String, CodingKey { case title, artists, date, views, likes case songID = "videoId" + case karaokeNumber + } +} + +public extension SingleSongResponseDTO { + struct KaraokeNumber: Decodable { + public let TJ, KY: Int? } } @@ -31,7 +39,8 @@ public extension SingleSongResponseDTO { reaction: "", views: views, last: 0, - date: date.changeDateFormat(origin: "yyMMdd", result: "yyyy.MM.dd") + date: date.changeDateFormat(origin: "yyMMdd", result: "yyyy.MM.dd"), + karaokeNumber: .init(TJ: karaokeNumber?.TJ ?? 0, KY: karaokeNumber?.KY ?? 0) ) } } diff --git a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SongCreditsResponseDTO.swift b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SongCreditsResponseDTO.swift index c347dbd2f..49d31d94c 100644 --- a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SongCreditsResponseDTO.swift +++ b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SongCreditsResponseDTO.swift @@ -10,30 +10,15 @@ import Foundation import SongsDomainInterface public struct SongCreditsResponseDTO: Decodable { - let vocal, featuring: [String] - let original: String - let producing, lyrics, relyrics, compose: [String] - let arrange, mixing, mastering, session: [String] - let chorus, vocalGuide, trainer: [String] + let type: String + let names: [String] } public extension SongCreditsResponseDTO { func toDomain() -> SongCreditsEntity { return SongCreditsEntity( - vocal: vocal, - featuring: featuring, - original: original, - producing: producing, - lyrics: lyrics, - relyrics: relyrics, - compose: compose, - arrange: arrange, - mixing: mixing, - mastering: mastering, - session: session, - chorus: chorus, - vocalGuide: vocalGuide, - trainer: trainer + type: type, + names: names ) } } diff --git a/Projects/Domains/SongsDomain/Sources/UseCase/FetchSongCreditsUseCaseImpl.swift b/Projects/Domains/SongsDomain/Sources/UseCase/FetchSongCreditsUseCaseImpl.swift index 3133895f6..fc26155a1 100644 --- a/Projects/Domains/SongsDomain/Sources/UseCase/FetchSongCreditsUseCaseImpl.swift +++ b/Projects/Domains/SongsDomain/Sources/UseCase/FetchSongCreditsUseCaseImpl.swift @@ -18,7 +18,7 @@ public struct FetchSongCreditsUseCaseImpl: FetchSongCreditsUseCase { self.songsRepository = songsRepository } - public func execute(id: String) -> RxSwift.Single { + public func execute(id: String) -> Single<[SongCreditsEntity]> { songsRepository.fetchSongCredits(id: id) } } From eaaa633d9e0b674aa61d384184f93a43f04385e0 Mon Sep 17 00:00:00 2001 From: "pikagreen@nate.com" Date: Tue, 11 Jun 2024 17:26:43 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift index ea16cbc5b..76e23ed72 100644 --- a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift +++ b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift @@ -43,6 +43,7 @@ public extension SongEntity { self.TJ = TJ self.KY = KY } + public let TJ, KY: Int } } From c3bb23e96d70e8678b5aeb64c0c64fa8d615bdad Mon Sep 17 00:00:00 2001 From: KTH Date: Tue, 11 Jun 2024 17:46:10 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20::=20[#598]=20?= =?UTF-8?q?=EB=8B=A8=EC=9D=BC=20=EB=85=B8=EB=9E=98=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?api=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Application/AppComponent+Songs.swift | 6 ++++++ .../Sources/Application/NeedleGenerated.swift | 1 + .../DataSource/RemoteSongsDataSource.swift | 1 + .../Interface/Repository/SongsRepository.swift | 1 + ...sUseCase.swift => FetchNewSongsUseCase.swift} | 0 .../Interface/UseCase/FetchSongUseCase.swift | 6 ++++++ .../SongsDomain/Sources/API/SongsAPI.swift | 5 ++++- .../DataSource/RemoteSongsDataSourceImpl.swift | 6 ++++++ .../Sources/Repository/SongsRepositoryImpl.swift | 4 ++++ .../Sources/UseCase/FetchSongUseCaseImpl.swift | 16 ++++++++++++++++ 10 files changed, 45 insertions(+), 1 deletion(-) rename Projects/Domains/SongsDomain/Interface/UseCase/{fetchNewSongsUseCase.swift => FetchNewSongsUseCase.swift} (100%) create mode 100644 Projects/Domains/SongsDomain/Interface/UseCase/FetchSongUseCase.swift create mode 100644 Projects/Domains/SongsDomain/Sources/UseCase/FetchSongUseCaseImpl.swift diff --git a/Projects/App/Sources/Application/AppComponent+Songs.swift b/Projects/App/Sources/Application/AppComponent+Songs.swift index 9d847c622..6fad7557c 100644 --- a/Projects/App/Sources/Application/AppComponent+Songs.swift +++ b/Projects/App/Sources/Application/AppComponent+Songs.swift @@ -38,6 +38,12 @@ public extension AppComponent { } } + var fetchSongUseCase: any FetchSongUseCase { + shared { + FetchSongUseCaseImpl(songsRepository: songsRepository) + } + } + var fetchLyricsUseCase: any FetchLyricsUseCase { shared { FetchLyricsUseCaseImpl(songsRepository: songsRepository) diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index 61cb35c81..ef24821e6 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -798,6 +798,7 @@ extension AppComponent: Registration { localTable["lyricDecoratingComponent-LyricDecoratingComponent"] = { self.lyricDecoratingComponent as Any } localTable["remoteSongsDataSource-any RemoteSongsDataSource"] = { self.remoteSongsDataSource as Any } localTable["songsRepository-any SongsRepository"] = { self.songsRepository as Any } + localTable["fetchSongUseCase-any FetchSongUseCase"] = { self.fetchSongUseCase as Any } localTable["fetchLyricsUseCase-any FetchLyricsUseCase"] = { self.fetchLyricsUseCase as Any } localTable["fetchNewSongsUseCase-any FetchNewSongsUseCase"] = { self.fetchNewSongsUseCase as Any } localTable["signInFactory-any SignInFactory"] = { self.signInFactory as Any } diff --git a/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift b/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift index 75e77ac32..e7a41c641 100644 --- a/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift +++ b/Projects/Domains/SongsDomain/Interface/DataSource/RemoteSongsDataSource.swift @@ -2,6 +2,7 @@ import Foundation import RxSwift public protocol RemoteSongsDataSource { + func fetchSong(id: String) -> Single func fetchLyrics(id: String) -> Single<[LyricsEntity]> func fetchSongCredits(id: String) -> Single<[SongCreditsEntity]> func fetchNewSongs(type: NewSongGroupType, page: Int, limit: Int) -> Single<[NewSongsEntity]> diff --git a/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift b/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift index 83b5b78d9..752f2315d 100644 --- a/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift +++ b/Projects/Domains/SongsDomain/Interface/Repository/SongsRepository.swift @@ -2,6 +2,7 @@ import Foundation import RxSwift public protocol SongsRepository { + func fetchSong(id: String) -> Single func fetchLyrics(id: String) -> Single<[LyricsEntity]> func fetchSongCredits(id: String) -> Single<[SongCreditsEntity]> func fetchNewSongs(type: NewSongGroupType, page: Int, limit: Int) -> Single<[NewSongsEntity]> diff --git a/Projects/Domains/SongsDomain/Interface/UseCase/fetchNewSongsUseCase.swift b/Projects/Domains/SongsDomain/Interface/UseCase/FetchNewSongsUseCase.swift similarity index 100% rename from Projects/Domains/SongsDomain/Interface/UseCase/fetchNewSongsUseCase.swift rename to Projects/Domains/SongsDomain/Interface/UseCase/FetchNewSongsUseCase.swift diff --git a/Projects/Domains/SongsDomain/Interface/UseCase/FetchSongUseCase.swift b/Projects/Domains/SongsDomain/Interface/UseCase/FetchSongUseCase.swift new file mode 100644 index 000000000..d952e637d --- /dev/null +++ b/Projects/Domains/SongsDomain/Interface/UseCase/FetchSongUseCase.swift @@ -0,0 +1,6 @@ +import Foundation +import RxSwift + +public protocol FetchSongUseCase { + func execute(id: String) -> Single +} diff --git a/Projects/Domains/SongsDomain/Sources/API/SongsAPI.swift b/Projects/Domains/SongsDomain/Sources/API/SongsAPI.swift index 58728b945..8a851a4a0 100644 --- a/Projects/Domains/SongsDomain/Sources/API/SongsAPI.swift +++ b/Projects/Domains/SongsDomain/Sources/API/SongsAPI.swift @@ -5,6 +5,7 @@ import Moya import SongsDomainInterface public enum SongsAPI { + case fetchSong(id: String) case fetchLyrics(id: String) case fetchCredits(id: String) case fetchNewSongs(type: NewSongGroupType, page: Int, limit: Int) @@ -17,6 +18,8 @@ extension SongsAPI: WMAPI { public var urlPath: String { switch self { + case let .fetchSong(id): + return "/\(id)" case let .fetchLyrics(id): return "/\(id)/lyrics" case let .fetchCredits(id): @@ -32,7 +35,7 @@ extension SongsAPI: WMAPI { public var task: Moya.Task { switch self { - case .fetchLyrics, .fetchCredits: + case .fetchSong, .fetchLyrics, .fetchCredits: return .requestPlain case let .fetchNewSongs(_, page, limit): diff --git a/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift b/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift index 6262002ef..69e2f4c27 100644 --- a/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift +++ b/Projects/Domains/SongsDomain/Sources/DataSource/RemoteSongsDataSourceImpl.swift @@ -4,6 +4,12 @@ import RxSwift import SongsDomainInterface public final class RemoteSongsDataSourceImpl: BaseRemoteDataSource, RemoteSongsDataSource { + public func fetchSong(id: String) -> Single { + request(.fetchSong(id: id)) + .map(SingleSongResponseDTO.self) + .map { $0.toDomain() } + } + public func fetchLyrics(id: String) -> Single<[LyricsEntity]> { request(.fetchLyrics(id: id)) .map([LyricsResponseDTO].self) diff --git a/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift b/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift index f1a86058b..776067917 100644 --- a/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift +++ b/Projects/Domains/SongsDomain/Sources/Repository/SongsRepositoryImpl.swift @@ -10,6 +10,10 @@ public final class SongsRepositoryImpl: SongsRepository { self.remoteSongsDataSource = remoteSongsDataSource } + public func fetchSong(id: String) -> Single { + remoteSongsDataSource.fetchSong(id: id) + } + public func fetchLyrics(id: String) -> Single<[LyricsEntity]> { remoteSongsDataSource.fetchLyrics(id: id) } diff --git a/Projects/Domains/SongsDomain/Sources/UseCase/FetchSongUseCaseImpl.swift b/Projects/Domains/SongsDomain/Sources/UseCase/FetchSongUseCaseImpl.swift new file mode 100644 index 000000000..731b2f8bd --- /dev/null +++ b/Projects/Domains/SongsDomain/Sources/UseCase/FetchSongUseCaseImpl.swift @@ -0,0 +1,16 @@ +import RxSwift +import SongsDomainInterface + +public struct FetchSongUseCaseImpl: FetchSongUseCase { + private let songsRepository: any SongsRepository + + public init( + songsRepository: SongsRepository + ) { + self.songsRepository = songsRepository + } + + public func execute(id: String) -> Single { + songsRepository.fetchSong(id: id) + } +} From fe86df5340180c0f98ed51ab3fdd93a2e33aa829 Mon Sep 17 00:00:00 2001 From: "pikagreen@nate.com" Date: Sat, 15 Jun 2024 17:00:55 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20[#598]=20DTO=20nu?= =?UTF-8?q?llable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Domains/SongsDomain/Interface/Entity/SongEntity.swift | 4 ++-- .../Sources/ResponseDTO/SingleSongResponseDTO.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift index e8c85d235..a5c12bf40 100644 --- a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift +++ b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift @@ -11,7 +11,7 @@ public struct SongEntity: Hashable, Equatable { last: Int, date: String, isSelected: Bool = false, - karaokeNumber: SongEntity.KaraokeNumber = .init(TJ: 0, KY: 0) + karaokeNumber: SongEntity.KaraokeNumber? = nil ) { self.id = id self.title = title @@ -30,7 +30,7 @@ public struct SongEntity: Hashable, Equatable { public let views, last: Int public let date: String public var isSelected: Bool - public let karaokeNumber: SongEntity.KaraokeNumber + public let karaokeNumber: SongEntity.KaraokeNumber? public func hash(into hasher: inout Hasher) { hasher.combine(id) diff --git a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift index e2a9b2e74..59a18fb86 100644 --- a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift +++ b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift @@ -40,7 +40,7 @@ public extension SingleSongResponseDTO { views: views, last: 0, date: date.changeDateFormat(origin: "yyMMdd", result: "yyyy.MM.dd"), - karaokeNumber: .init(TJ: karaokeNumber?.TJ ?? 0, KY: karaokeNumber?.KY ?? 0) + karaokeNumber: karaokeNumber == nil ? nil : .init(TJ: karaokeNumber?.TJ ?? 0, KY: karaokeNumber?.KY ?? 0) ) } } From 867fb5f8d7a9edbe94eccd952cd83cd49c75c40b Mon Sep 17 00:00:00 2001 From: "pikagreen@nate.com" Date: Sat, 15 Jun 2024 17:00:59 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Application/NeedleGenerated.swift | 192 +++++++++--------- 1 file changed, 97 insertions(+), 95 deletions(-) diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index 1f3fcd7c0..90a72d8ca 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -887,101 +887,103 @@ private func factorybe60e92b5190e00abf41e3b0c44298fc1c149afb(_ component: Needle #else extension AppComponent: Registration { public func registerItems() { - localTable["keychain-any Keychain"] = { [unowned self] in self.keychain as Any } - localTable["homeComponent-HomeComponent"] = { [unowned self] in self.homeComponent as Any } - localTable["newSongsComponent-NewSongsComponent"] = { [unowned self] in self.newSongsComponent as Any } - localTable["newSongsContentComponent-NewSongsContentComponent"] = { [unowned self] in self.newSongsContentComponent as Any } - localTable["lyricHighlightingFactory-any LyricHighlightingFactory"] = { [unowned self] in self.lyricHighlightingFactory as Any } - localTable["lyricDecoratingComponent-LyricDecoratingComponent"] = { [unowned self] in self.lyricDecoratingComponent as Any } - localTable["remoteSongsDataSource-any RemoteSongsDataSource"] = { [unowned self] in self.remoteSongsDataSource as Any } - localTable["songsRepository-any SongsRepository"] = { [unowned self] in self.songsRepository as Any } - localTable["fetchLyricsUseCase-any FetchLyricsUseCase"] = { [unowned self] in self.fetchLyricsUseCase as Any } - localTable["fetchNewSongsUseCase-any FetchNewSongsUseCase"] = { [unowned self] in self.fetchNewSongsUseCase as Any } - localTable["signInFactory-any SignInFactory"] = { [unowned self] in self.signInFactory as Any } - localTable["storageFactory-any StorageFactory"] = { [unowned self] in self.storageFactory as Any } - localTable["requestComponent-RequestComponent"] = { [unowned self] in self.requestComponent as Any } - localTable["localAuthDataSource-any LocalAuthDataSource"] = { [unowned self] in self.localAuthDataSource as Any } - localTable["remoteAuthDataSource-any RemoteAuthDataSource"] = { [unowned self] in self.remoteAuthDataSource as Any } - localTable["authRepository-any AuthRepository"] = { [unowned self] in self.authRepository as Any } - localTable["fetchTokenUseCase-any FetchTokenUseCase"] = { [unowned self] in self.fetchTokenUseCase as Any } - localTable["fetchNaverUserInfoUseCase-any FetchNaverUserInfoUseCase"] = { [unowned self] in self.fetchNaverUserInfoUseCase as Any } - localTable["logoutUseCase-any LogoutUseCase"] = { [unowned self] in self.logoutUseCase as Any } - localTable["checkIsExistAccessTokenUseCase-any CheckIsExistAccessTokenUseCase"] = { [unowned self] in self.checkIsExistAccessTokenUseCase as Any } - localTable["remoteLikeDataSource-any RemoteLikeDataSource"] = { [unowned self] in self.remoteLikeDataSource as Any } - localTable["likeRepository-any LikeRepository"] = { [unowned self] in self.likeRepository as Any } - localTable["fetchLikeNumOfSongUseCase-any FetchLikeNumOfSongUseCase"] = { [unowned self] in self.fetchLikeNumOfSongUseCase as Any } - localTable["addLikeSongUseCase-any AddLikeSongUseCase"] = { [unowned self] in self.addLikeSongUseCase as Any } - localTable["cancelLikeSongUseCase-any CancelLikeSongUseCase"] = { [unowned self] in self.cancelLikeSongUseCase as Any } - localTable["playlistDetailFactory-any PlaylistDetailFactory"] = { [unowned self] in self.playlistDetailFactory as Any } - localTable["myPlayListComponent-MyPlayListComponent"] = { [unowned self] in self.myPlayListComponent as Any } - localTable["remotePlayListDataSource-any RemotePlayListDataSource"] = { [unowned self] in self.remotePlayListDataSource as Any } - localTable["playListRepository-any PlayListRepository"] = { [unowned self] in self.playListRepository as Any } - localTable["fetchRecommendPlayListUseCase-any FetchRecommendPlayListUseCase"] = { [unowned self] in self.fetchRecommendPlayListUseCase as Any } - localTable["fetchPlayListDetailUseCase-any FetchPlayListDetailUseCase"] = { [unowned self] in self.fetchPlayListDetailUseCase as Any } - localTable["createPlayListUseCase-any CreatePlayListUseCase"] = { [unowned self] in self.createPlayListUseCase as Any } - localTable["updatePlaylistUseCase-any UpdatePlaylistUseCase"] = { [unowned self] in self.updatePlaylistUseCase as Any } - localTable["updateTitleAndPrivateUseCase-any UpdateTitleAndPrivateUseCase"] = { [unowned self] in self.updateTitleAndPrivateUseCase as Any } - localTable["addSongIntoPlayListUseCase-any AddSongIntoPlayListUseCase"] = { [unowned self] in self.addSongIntoPlayListUseCase as Any } - localTable["removeSongsUseCase-any RemoveSongsUseCase"] = { [unowned self] in self.removeSongsUseCase as Any } - localTable["uploadPlaylistImageUseCase-any UploadPlaylistImageUseCase"] = { [unowned self] in self.uploadPlaylistImageUseCase as Any } - localTable["artistComponent-ArtistComponent"] = { [unowned self] in self.artistComponent as Any } - localTable["remoteArtistDataSource-RemoteArtistDataSourceImpl"] = { [unowned self] in self.remoteArtistDataSource as Any } - localTable["artistRepository-any ArtistRepository"] = { [unowned self] in self.artistRepository as Any } - localTable["fetchArtistListUseCase-any FetchArtistListUseCase"] = { [unowned self] in self.fetchArtistListUseCase as Any } - localTable["artistDetailComponent-ArtistDetailComponent"] = { [unowned self] in self.artistDetailComponent as Any } - localTable["fetchArtistSongListUseCase-any FetchArtistSongListUseCase"] = { [unowned self] in self.fetchArtistSongListUseCase as Any } - localTable["artistMusicComponent-ArtistMusicComponent"] = { [unowned self] in self.artistMusicComponent as Any } - localTable["artistMusicContentComponent-ArtistMusicContentComponent"] = { [unowned self] in self.artistMusicContentComponent as Any } - localTable["profilePopComponent-ProfilePopComponent"] = { [unowned self] in self.profilePopComponent as Any } - localTable["favoriteComponent-FavoriteComponent"] = { [unowned self] in self.favoriteComponent as Any } - localTable["remoteUserDataSource-any RemoteUserDataSource"] = { [unowned self] in self.remoteUserDataSource as Any } - localTable["userRepository-any UserRepository"] = { [unowned self] in self.userRepository as Any } - localTable["fetchProfileListUseCase-any FetchProfileListUseCase"] = { [unowned self] in self.fetchProfileListUseCase as Any } - localTable["setProfileUseCase-any SetProfileUseCase"] = { [unowned self] in self.setProfileUseCase as Any } - localTable["setUserNameUseCase-any SetUserNameUseCase"] = { [unowned self] in self.setUserNameUseCase as Any } - localTable["fetchPlayListUseCase-any FetchPlayListUseCase"] = { [unowned self] in self.fetchPlayListUseCase as Any } - localTable["fetchFavoriteSongsUseCase-any FetchFavoriteSongsUseCase"] = { [unowned self] in self.fetchFavoriteSongsUseCase as Any } - localTable["editFavoriteSongsOrderUseCase-any EditFavoriteSongsOrderUseCase"] = { [unowned self] in self.editFavoriteSongsOrderUseCase as Any } - localTable["editPlayListOrderUseCase-any EditPlayListOrderUseCase"] = { [unowned self] in self.editPlayListOrderUseCase as Any } - localTable["deletePlayListUseCase-any DeletePlayListUseCase"] = { [unowned self] in self.deletePlayListUseCase as Any } - localTable["deleteFavoriteListUseCase-any DeleteFavoriteListUseCase"] = { [unowned self] in self.deleteFavoriteListUseCase as Any } - localTable["fetchUserInfoUseCase-any FetchUserInfoUseCase"] = { [unowned self] in self.fetchUserInfoUseCase as Any } - localTable["withdrawUserInfoUseCase-any WithdrawUserInfoUseCase"] = { [unowned self] in self.withdrawUserInfoUseCase as Any } - localTable["mainContainerComponent-MainContainerComponent"] = { [unowned self] in self.mainContainerComponent as Any } - localTable["bottomTabBarComponent-BottomTabBarComponent"] = { [unowned self] in self.bottomTabBarComponent as Any } - localTable["mainTabBarComponent-MainTabBarComponent"] = { [unowned self] in self.mainTabBarComponent as Any } - localTable["playerComponent-PlayerComponent"] = { [unowned self] in self.playerComponent as Any } - localTable["playlistComponent-PlaylistComponent"] = { [unowned self] in self.playlistComponent as Any } - localTable["openSourceLicenseComponent-OpenSourceLicenseComponent"] = { [unowned self] in self.openSourceLicenseComponent as Any } - localTable["serviceInfoComponent-ServiceInfoComponent"] = { [unowned self] in self.serviceInfoComponent as Any } - localTable["permissionComponent-PermissionComponent"] = { [unowned self] in self.permissionComponent as Any } - localTable["noticePopupComponent-NoticePopupComponent"] = { [unowned self] in self.noticePopupComponent as Any } - localTable["noticeComponent-NoticeComponent"] = { [unowned self] in self.noticeComponent as Any } - localTable["noticeDetailComponent-NoticeDetailComponent"] = { [unowned self] in self.noticeDetailComponent as Any } - localTable["remoteNoticeDataSource-any RemoteNoticeDataSource"] = { [unowned self] in self.remoteNoticeDataSource as Any } - localTable["noticeRepository-any NoticeRepository"] = { [unowned self] in self.noticeRepository as Any } - localTable["fetchNoticeUseCase-any FetchNoticeUseCase"] = { [unowned self] in self.fetchNoticeUseCase as Any } - localTable["fetchNoticeCategoriesUseCase-any FetchNoticeCategoriesUseCase"] = { [unowned self] in self.fetchNoticeCategoriesUseCase as Any } - localTable["multiPurposePopUpFactory-any MultiPurposePopUpFactory"] = { [unowned self] in self.multiPurposePopUpFactory as Any } - localTable["textPopUpFactory-any TextPopUpFactory"] = { [unowned self] in self.textPopUpFactory as Any } - localTable["containSongsFactory-any ContainSongsFactory"] = { [unowned self] in self.containSongsFactory as Any } - localTable["privacyComponent-PrivacyComponent"] = { [unowned self] in self.privacyComponent as Any } - localTable["serviceTermsComponent-ServiceTermsComponent"] = { [unowned self] in self.serviceTermsComponent as Any } - localTable["questionComponent-QuestionComponent"] = { [unowned self] in self.questionComponent as Any } - localTable["faqComponent-FaqComponent"] = { [unowned self] in self.faqComponent as Any } - localTable["faqContentComponent-FaqContentComponent"] = { [unowned self] in self.faqContentComponent as Any } - localTable["remoteFaqDataSource-any RemoteFaqDataSource"] = { [unowned self] in self.remoteFaqDataSource as Any } - localTable["faqRepository-any FaqRepository"] = { [unowned self] in self.faqRepository as Any } - localTable["fetchFaqCategoriesUseCase-any FetchFaqCategoriesUseCase"] = { [unowned self] in self.fetchFaqCategoriesUseCase as Any } - localTable["fetchFaqUseCase-any FetchFaqUseCase"] = { [unowned self] in self.fetchFaqUseCase as Any } - localTable["remoteAppDataSource-any RemoteAppDataSource"] = { [unowned self] in self.remoteAppDataSource as Any } - localTable["appRepository-any AppRepository"] = { [unowned self] in self.appRepository as Any } - localTable["fetchAppCheckUseCase-any FetchAppCheckUseCase"] = { [unowned self] in self.fetchAppCheckUseCase as Any } - localTable["chartComponent-ChartComponent"] = { [unowned self] in self.chartComponent as Any } - localTable["chartContentComponent-ChartContentComponent"] = { [unowned self] in self.chartContentComponent as Any } - localTable["remoteChartDataSource-any RemoteChartDataSource"] = { [unowned self] in self.remoteChartDataSource as Any } - localTable["chartRepository-any ChartRepository"] = { [unowned self] in self.chartRepository as Any } - localTable["fetchChartRankingUseCase-any FetchChartRankingUseCase"] = { [unowned self] in self.fetchChartRankingUseCase as Any } + + localTable["keychain-any Keychain"] = { self.keychain as Any } + localTable["homeComponent-HomeComponent"] = { self.homeComponent as Any } + localTable["newSongsComponent-NewSongsComponent"] = { self.newSongsComponent as Any } + localTable["newSongsContentComponent-NewSongsContentComponent"] = { self.newSongsContentComponent as Any } + localTable["lyricHighlightingFactory-any LyricHighlightingFactory"] = { self.lyricHighlightingFactory as Any } + localTable["lyricDecoratingComponent-LyricDecoratingComponent"] = { self.lyricDecoratingComponent as Any } + localTable["remoteSongsDataSource-any RemoteSongsDataSource"] = { self.remoteSongsDataSource as Any } + localTable["songsRepository-any SongsRepository"] = { self.songsRepository as Any } + localTable["fetchSongUseCase-any FetchSongUseCase"] = { self.fetchSongUseCase as Any } + localTable["fetchLyricsUseCase-any FetchLyricsUseCase"] = { self.fetchLyricsUseCase as Any } + localTable["fetchNewSongsUseCase-any FetchNewSongsUseCase"] = { self.fetchNewSongsUseCase as Any } + localTable["signInFactory-any SignInFactory"] = { self.signInFactory as Any } + localTable["storageFactory-any StorageFactory"] = { self.storageFactory as Any } + localTable["requestComponent-RequestComponent"] = { self.requestComponent as Any } + localTable["localAuthDataSource-any LocalAuthDataSource"] = { self.localAuthDataSource as Any } + localTable["remoteAuthDataSource-any RemoteAuthDataSource"] = { self.remoteAuthDataSource as Any } + localTable["authRepository-any AuthRepository"] = { self.authRepository as Any } + localTable["fetchTokenUseCase-any FetchTokenUseCase"] = { self.fetchTokenUseCase as Any } + localTable["fetchNaverUserInfoUseCase-any FetchNaverUserInfoUseCase"] = { self.fetchNaverUserInfoUseCase as Any } + localTable["logoutUseCase-any LogoutUseCase"] = { self.logoutUseCase as Any } + localTable["checkIsExistAccessTokenUseCase-any CheckIsExistAccessTokenUseCase"] = { self.checkIsExistAccessTokenUseCase as Any } + localTable["remoteLikeDataSource-any RemoteLikeDataSource"] = { self.remoteLikeDataSource as Any } + localTable["likeRepository-any LikeRepository"] = { self.likeRepository as Any } + localTable["fetchLikeNumOfSongUseCase-any FetchLikeNumOfSongUseCase"] = { self.fetchLikeNumOfSongUseCase as Any } + localTable["addLikeSongUseCase-any AddLikeSongUseCase"] = { self.addLikeSongUseCase as Any } + localTable["cancelLikeSongUseCase-any CancelLikeSongUseCase"] = { self.cancelLikeSongUseCase as Any } + localTable["playlistDetailFactory-any PlaylistDetailFactory"] = { self.playlistDetailFactory as Any } + localTable["myPlayListComponent-MyPlayListComponent"] = { self.myPlayListComponent as Any } + localTable["remotePlayListDataSource-any RemotePlayListDataSource"] = { self.remotePlayListDataSource as Any } + localTable["playListRepository-any PlayListRepository"] = { self.playListRepository as Any } + localTable["fetchRecommendPlayListUseCase-any FetchRecommendPlayListUseCase"] = { self.fetchRecommendPlayListUseCase as Any } + localTable["fetchPlayListDetailUseCase-any FetchPlayListDetailUseCase"] = { self.fetchPlayListDetailUseCase as Any } + localTable["createPlayListUseCase-any CreatePlayListUseCase"] = { self.createPlayListUseCase as Any } + localTable["updatePlaylistUseCase-any UpdatePlaylistUseCase"] = { self.updatePlaylistUseCase as Any } + localTable["updateTitleAndPrivateUseCase-any UpdateTitleAndPrivateUseCase"] = { self.updateTitleAndPrivateUseCase as Any } + localTable["addSongIntoPlayListUseCase-any AddSongIntoPlayListUseCase"] = { self.addSongIntoPlayListUseCase as Any } + localTable["removeSongsUseCase-any RemoveSongsUseCase"] = { self.removeSongsUseCase as Any } + localTable["uploadPlaylistImageUseCase-any UploadPlaylistImageUseCase"] = { self.uploadPlaylistImageUseCase as Any } + localTable["artistComponent-ArtistComponent"] = { self.artistComponent as Any } + localTable["remoteArtistDataSource-RemoteArtistDataSourceImpl"] = { self.remoteArtistDataSource as Any } + localTable["artistRepository-any ArtistRepository"] = { self.artistRepository as Any } + localTable["fetchArtistListUseCase-any FetchArtistListUseCase"] = { self.fetchArtistListUseCase as Any } + localTable["artistDetailComponent-ArtistDetailComponent"] = { self.artistDetailComponent as Any } + localTable["fetchArtistSongListUseCase-any FetchArtistSongListUseCase"] = { self.fetchArtistSongListUseCase as Any } + localTable["artistMusicComponent-ArtistMusicComponent"] = { self.artistMusicComponent as Any } + localTable["artistMusicContentComponent-ArtistMusicContentComponent"] = { self.artistMusicContentComponent as Any } + localTable["profilePopComponent-ProfilePopComponent"] = { self.profilePopComponent as Any } + localTable["favoriteComponent-FavoriteComponent"] = { self.favoriteComponent as Any } + localTable["remoteUserDataSource-any RemoteUserDataSource"] = { self.remoteUserDataSource as Any } + localTable["userRepository-any UserRepository"] = { self.userRepository as Any } + localTable["fetchProfileListUseCase-any FetchProfileListUseCase"] = { self.fetchProfileListUseCase as Any } + localTable["setProfileUseCase-any SetProfileUseCase"] = { self.setProfileUseCase as Any } + localTable["setUserNameUseCase-any SetUserNameUseCase"] = { self.setUserNameUseCase as Any } + localTable["fetchPlayListUseCase-any FetchPlayListUseCase"] = { self.fetchPlayListUseCase as Any } + localTable["fetchFavoriteSongsUseCase-any FetchFavoriteSongsUseCase"] = { self.fetchFavoriteSongsUseCase as Any } + localTable["editFavoriteSongsOrderUseCase-any EditFavoriteSongsOrderUseCase"] = { self.editFavoriteSongsOrderUseCase as Any } + localTable["editPlayListOrderUseCase-any EditPlayListOrderUseCase"] = { self.editPlayListOrderUseCase as Any } + localTable["deletePlayListUseCase-any DeletePlayListUseCase"] = { self.deletePlayListUseCase as Any } + localTable["deleteFavoriteListUseCase-any DeleteFavoriteListUseCase"] = { self.deleteFavoriteListUseCase as Any } + localTable["fetchUserInfoUseCase-any FetchUserInfoUseCase"] = { self.fetchUserInfoUseCase as Any } + localTable["withdrawUserInfoUseCase-any WithdrawUserInfoUseCase"] = { self.withdrawUserInfoUseCase as Any } + localTable["mainContainerComponent-MainContainerComponent"] = { self.mainContainerComponent as Any } + localTable["bottomTabBarComponent-BottomTabBarComponent"] = { self.bottomTabBarComponent as Any } + localTable["mainTabBarComponent-MainTabBarComponent"] = { self.mainTabBarComponent as Any } + localTable["playerComponent-PlayerComponent"] = { self.playerComponent as Any } + localTable["playlistComponent-PlaylistComponent"] = { self.playlistComponent as Any } + localTable["openSourceLicenseComponent-OpenSourceLicenseComponent"] = { self.openSourceLicenseComponent as Any } + localTable["serviceInfoComponent-ServiceInfoComponent"] = { self.serviceInfoComponent as Any } + localTable["permissionComponent-PermissionComponent"] = { self.permissionComponent as Any } + localTable["noticePopupComponent-NoticePopupComponent"] = { self.noticePopupComponent as Any } + localTable["noticeComponent-NoticeComponent"] = { self.noticeComponent as Any } + localTable["noticeDetailComponent-NoticeDetailComponent"] = { self.noticeDetailComponent as Any } + localTable["remoteNoticeDataSource-any RemoteNoticeDataSource"] = { self.remoteNoticeDataSource as Any } + localTable["noticeRepository-any NoticeRepository"] = { self.noticeRepository as Any } + localTable["fetchNoticeUseCase-any FetchNoticeUseCase"] = { self.fetchNoticeUseCase as Any } + localTable["fetchNoticeCategoriesUseCase-any FetchNoticeCategoriesUseCase"] = { self.fetchNoticeCategoriesUseCase as Any } + localTable["multiPurposePopUpFactory-any MultiPurposePopUpFactory"] = { self.multiPurposePopUpFactory as Any } + localTable["textPopUpFactory-any TextPopUpFactory"] = { self.textPopUpFactory as Any } + localTable["containSongsFactory-any ContainSongsFactory"] = { self.containSongsFactory as Any } + localTable["privacyComponent-PrivacyComponent"] = { self.privacyComponent as Any } + localTable["serviceTermsComponent-ServiceTermsComponent"] = { self.serviceTermsComponent as Any } + localTable["questionComponent-QuestionComponent"] = { self.questionComponent as Any } + localTable["faqComponent-FaqComponent"] = { self.faqComponent as Any } + localTable["faqContentComponent-FaqContentComponent"] = { self.faqContentComponent as Any } + localTable["remoteFaqDataSource-any RemoteFaqDataSource"] = { self.remoteFaqDataSource as Any } + localTable["faqRepository-any FaqRepository"] = { self.faqRepository as Any } + localTable["fetchFaqCategoriesUseCase-any FetchFaqCategoriesUseCase"] = { self.fetchFaqCategoriesUseCase as Any } + localTable["fetchFaqUseCase-any FetchFaqUseCase"] = { self.fetchFaqUseCase as Any } + localTable["remoteAppDataSource-any RemoteAppDataSource"] = { self.remoteAppDataSource as Any } + localTable["appRepository-any AppRepository"] = { self.appRepository as Any } + localTable["fetchAppCheckUseCase-any FetchAppCheckUseCase"] = { self.fetchAppCheckUseCase as Any } + localTable["chartComponent-ChartComponent"] = { self.chartComponent as Any } + localTable["chartContentComponent-ChartContentComponent"] = { self.chartContentComponent as Any } + localTable["remoteChartDataSource-any RemoteChartDataSource"] = { self.remoteChartDataSource as Any } + localTable["chartRepository-any ChartRepository"] = { self.chartRepository as Any } + localTable["fetchChartRankingUseCase-any FetchChartRankingUseCase"] = { self.fetchChartRankingUseCase as Any } } } extension ArtistComponent: Registration { From d0d40edacd2a1a9d4b7cd0233fd41cc747a54952 Mon Sep 17 00:00:00 2001 From: "pikagreen@nate.com" Date: Sat, 15 Jun 2024 17:12:56 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20[#598]=20DTO=20nu?= =?UTF-8?q?llable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Domains/SongsDomain/Interface/Entity/SongEntity.swift | 8 ++++---- .../Sources/ResponseDTO/SingleSongResponseDTO.swift | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift index a5c12bf40..c2aff8cfd 100644 --- a/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift +++ b/Projects/Domains/SongsDomain/Interface/Entity/SongEntity.swift @@ -11,7 +11,7 @@ public struct SongEntity: Hashable, Equatable { last: Int, date: String, isSelected: Bool = false, - karaokeNumber: SongEntity.KaraokeNumber? = nil + karaokeNumber: SongEntity.KaraokeNumber = .init(TJ: nil, KY: nil) ) { self.id = id self.title = title @@ -30,7 +30,7 @@ public struct SongEntity: Hashable, Equatable { public let views, last: Int public let date: String public var isSelected: Bool - public let karaokeNumber: SongEntity.KaraokeNumber? + public let karaokeNumber: SongEntity.KaraokeNumber public func hash(into hasher: inout Hasher) { hasher.combine(id) @@ -43,11 +43,11 @@ public struct SongEntity: Hashable, Equatable { public extension SongEntity { struct KaraokeNumber { - public init (TJ: Int, KY: Int) { + public init (TJ: Int?, KY: Int?) { self.TJ = TJ self.KY = KY } - public let TJ, KY: Int + public let TJ, KY: Int? } } diff --git a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift index 59a18fb86..35a35b535 100644 --- a/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift +++ b/Projects/Domains/SongsDomain/Sources/ResponseDTO/SingleSongResponseDTO.swift @@ -14,7 +14,7 @@ public struct SingleSongResponseDTO: Decodable { public let songID, title: String public let artists: [String] public let date, views, likes: Int - public let karaokeNumber: SingleSongResponseDTO.KaraokeNumber? + public let karaokeNumber: SingleSongResponseDTO.KaraokeNumber enum CodingKeys: String, CodingKey { case title, artists, date, views, likes @@ -40,7 +40,7 @@ public extension SingleSongResponseDTO { views: views, last: 0, date: date.changeDateFormat(origin: "yyMMdd", result: "yyyy.MM.dd"), - karaokeNumber: karaokeNumber == nil ? nil : .init(TJ: karaokeNumber?.TJ ?? 0, KY: karaokeNumber?.KY ?? 0) + karaokeNumber: .init(TJ: karaokeNumber.TJ, KY: karaokeNumber.KY) ) } }