From df9b838b9911de2abe1b26f619de3f35be2933db Mon Sep 17 00:00:00 2001 From: Hamp Date: Sat, 6 Jul 2024 21:40:32 +0900 Subject: [PATCH 1/8] =?UTF-8?q?:zap:=20::=20Usecase=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Application/AppComponent+Playlist.swift | 8 ++++++++ .../DataSource/RemoteImageDataSource.swift | 1 + .../Interface/Entity/DefaultImageEntity.swift | 14 +++++++++++++ .../Repository/ImageRepository.swift | 1 + .../FetchDefaultPlaylistImageUseCase.swift | 6 ++++++ .../ImageDomain/Sources/API/ImageAPI.swift | 11 +++++----- .../RemoteImageDataSourceImpl.swift | 6 ++++++ .../Repository/ImageRepositoryImpl.swift | 4 ++++ .../FetchDefaultImageResponseDTO.swift | 18 +++++++++++++++++ .../FetchProfileListResponseDTO.swift | 1 + ...FetchDefaultPlaylistImageUseCaseImpl.swift | 18 +++++++++++++++++ .../Features/PlaylistFeature/Project.swift | 6 ++++-- .../DefaultPlaylistImageComponent.swift | 9 ++++++--- .../DefaultPlaylistImageReactor.swift | 19 +++++++++++++----- .../DefaultPlaylistImageViewController.swift | 20 ++++++++++++------- .../Sources/Views/DefaultThumbnailCell.swift | 9 +++++---- 16 files changed, 124 insertions(+), 27 deletions(-) create mode 100644 Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift create mode 100644 Projects/Domains/ImageDomain/Interface/UseCase/FetchDefaultPlaylistImageUseCase.swift create mode 100644 Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift create mode 100644 Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift diff --git a/Projects/App/Sources/Application/AppComponent+Playlist.swift b/Projects/App/Sources/Application/AppComponent+Playlist.swift index 85b1076e2..895028c55 100644 --- a/Projects/App/Sources/Application/AppComponent+Playlist.swift +++ b/Projects/App/Sources/Application/AppComponent+Playlist.swift @@ -5,6 +5,8 @@ import PlaylistDomainInterface import PlaylistFeature import PlaylistFeatureInterface import StorageFeature +import ImageDomainInterface +import ImageDomain // MARK: 변수명 주의 // AppComponent 내 변수 == Dependency 내 변수 이름 같아야함 @@ -123,4 +125,10 @@ public extension AppComponent { CheckSubscriptionUseCaseImpl(playlistRepository: playlistRepository) } } + + var fetchDefaultPlaylistImageUseCase: any FetchDefaultPlaylistImageUseCase { + shared { + FetchDefaultPlaylistImageUseCaseImpl(imageRepository: imageRepository) + } + } } diff --git a/Projects/Domains/ImageDomain/Interface/DataSource/RemoteImageDataSource.swift b/Projects/Domains/ImageDomain/Interface/DataSource/RemoteImageDataSource.swift index 3ac365eaf..ef6eeb0da 100644 --- a/Projects/Domains/ImageDomain/Interface/DataSource/RemoteImageDataSource.swift +++ b/Projects/Domains/ImageDomain/Interface/DataSource/RemoteImageDataSource.swift @@ -4,4 +4,5 @@ import RxSwift public protocol RemoteImageDataSource { func fetchLyricDecoratingBackground() -> Single<[LyricDecoratingBackgroundEntity]> func fetchProfileList() -> Single<[ProfileListEntity]> + func fetchDefaultPlaylistImage() -> Single<[DefaultImageEntity]> } diff --git a/Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift b/Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift new file mode 100644 index 000000000..4862de68f --- /dev/null +++ b/Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift @@ -0,0 +1,14 @@ +import Foundation + + +public struct DefaultImageEntity : Hashable, Equatable { + + public let name: String + public let url: String + + public init(name: String, url: String) { + self.name = name + self.url = url + } + +} diff --git a/Projects/Domains/ImageDomain/Interface/Repository/ImageRepository.swift b/Projects/Domains/ImageDomain/Interface/Repository/ImageRepository.swift index 656de88eb..ef3c8e41e 100644 --- a/Projects/Domains/ImageDomain/Interface/Repository/ImageRepository.swift +++ b/Projects/Domains/ImageDomain/Interface/Repository/ImageRepository.swift @@ -4,4 +4,5 @@ import RxSwift public protocol ImageRepository { func fetchLyricDecoratingBackground() -> Single<[LyricDecoratingBackgroundEntity]> func fetchProfileList() -> Single<[ProfileListEntity]> + func fetchDefaultPlaylistImage() -> Single<[DefaultImageEntity]> } diff --git a/Projects/Domains/ImageDomain/Interface/UseCase/FetchDefaultPlaylistImageUseCase.swift b/Projects/Domains/ImageDomain/Interface/UseCase/FetchDefaultPlaylistImageUseCase.swift new file mode 100644 index 000000000..dca426e27 --- /dev/null +++ b/Projects/Domains/ImageDomain/Interface/UseCase/FetchDefaultPlaylistImageUseCase.swift @@ -0,0 +1,6 @@ +import Foundation +import RxSwift + +public protocol FetchDefaultPlaylistImageUseCase { + func execute() -> Single<[DefaultImageEntity]> +} diff --git a/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift b/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift index c84382c85..1d505364a 100644 --- a/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift +++ b/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift @@ -7,6 +7,7 @@ import Moya public enum ImageAPI { case fetchLyricDecoratingBackground case fetchProfileList + case fetchDefaultPlaylistImage } extension ImageAPI: WMAPI { @@ -20,23 +21,21 @@ extension ImageAPI: WMAPI { return "/lyrics/backgrounds" case .fetchProfileList: return "/user/profiles" + case .fetchDefaultPlaylistImage: + return "/playlists" } } public var method: Moya.Method { switch self { - case .fetchLyricDecoratingBackground: - return .get - case .fetchProfileList: + case .fetchLyricDecoratingBackground, .fetchDefaultPlaylistImage , .fetchProfileList: return .get } } public var task: Moya.Task { switch self { - case .fetchLyricDecoratingBackground: - return .requestPlain - case .fetchProfileList: + case .fetchLyricDecoratingBackground, .fetchProfileList , .fetchDefaultPlaylistImage: return .requestPlain } } diff --git a/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift b/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift index 86190a45d..fb0c50eb2 100644 --- a/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift +++ b/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift @@ -15,4 +15,10 @@ public final class RemoteImageDataSourceImpl: BaseRemoteDataSource, Re .map([FetchProfileListResponseDTO].self) .map { $0.map { $0.toDomain() } } } + + public func fetchDefaultPlaylistImage() -> Single<[DefaultImageEntity]> { + return request(.fetchDefaultPlaylistImage) + .map([FetchDefaultImageResponseDTO].self) + .map{ $0.map{$0.toDomain()} } + } } diff --git a/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift b/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift index 877d943ca..61abf5428 100644 --- a/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift +++ b/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift @@ -18,4 +18,8 @@ public final class ImageRepositoryImpl: ImageRepository { public func fetchProfileList() -> Single<[ProfileListEntity]> { remoteImageDataSource.fetchProfileList() } + + public func fetchDefaultPlaylistImage() -> Single<[DefaultImageEntity]> { + remoteImageDataSource.fetchDefaultPlaylistImage() + } } diff --git a/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift new file mode 100644 index 000000000..0a9dcbfa2 --- /dev/null +++ b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift @@ -0,0 +1,18 @@ +import Foundation +import ImageDomainInterface + +public struct FetchDefaultImageResponseDTO: Decodable, Equatable { + public let type: String + public let name: String + public let url: String +} + +public extension FetchDefaultImageResponseDTO { + func toDomain() -> DefaultImageEntity { + DefaultImageEntity( + name: name, + url: url + ) + } +} + diff --git a/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift index f18813968..297b6ab00 100644 --- a/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift +++ b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift @@ -13,5 +13,6 @@ public extension FetchProfileListResponseDTO { name: name, url: url ) + } } diff --git a/Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift b/Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift new file mode 100644 index 000000000..595bc7e2f --- /dev/null +++ b/Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift @@ -0,0 +1,18 @@ +import Foundation +import ImageDomainInterface +import RxSwift + +public struct FetchDefaultPlaylistImageUseCaseImpl: FetchDefaultPlaylistImageUseCase { + + private let imageRepository: any ImageRepository + + public init( + imageRepository: ImageRepository + ) { + self.imageRepository = imageRepository + } + + public func execute() -> Single<[DefaultImageEntity]> { + imageRepository.fetchDefaultPlaylistImage() + } +} diff --git a/Projects/Features/PlaylistFeature/Project.swift b/Projects/Features/PlaylistFeature/Project.swift index 7a06f7fb9..b3a2ed5f4 100644 --- a/Projects/Features/PlaylistFeature/Project.swift +++ b/Projects/Features/PlaylistFeature/Project.swift @@ -6,14 +6,16 @@ let project = Project.module( name: ModulePaths.Feature.PlaylistFeature.rawValue, targets: [ .interface(module: .feature(.PlaylistFeature), dependencies: [ - .feature(target: .BaseFeature, type: .interface) + .feature(target: .BaseFeature, type: .interface), + ]), .implements( module: .feature(.PlaylistFeature), dependencies: [ .feature(target: .BaseFeature), .feature(target: .PlaylistFeature, type: .interface), .domain(target: .AuthDomain, type: .interface), - .domain(target: .PlaylistDomain, type: .interface) + .domain(target: .PlaylistDomain, type: .interface), + .domain(target: .ImageDomain, type: .interface) ] ), .testing(module: .feature(.PlaylistFeature), dependencies: [ diff --git a/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift b/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift index 65a8b14b7..b9945080d 100644 --- a/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift +++ b/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift @@ -2,16 +2,19 @@ import BaseFeature import BaseFeatureInterface import NeedleFoundation import PlaylistFeatureInterface +import ImageDomainInterface import UIKit public protocol DefaultPlaylistImageDependency: Dependency { - #warning("usecase 주입") - // + var fetchDefaultPlaylistImageUseCase: any FetchDefaultPlaylistImageUseCase { get } } public final class DefaultPlaylistImageComponent: Component, DefaultPlaylistImageFactory { public func makeView(_ delegate: any DefaultPlaylistImageDelegate) -> UIViewController { - DefaultPlaylistImageViewController(delegate: delegate, reactor: DefaultPlaylistImageReactor()) + DefaultPlaylistImageViewController(delegate: delegate, reactor: DefaultPlaylistImageReactor( + fetchDefaultPlaylistImageUseCase: dependency.fetchDefaultPlaylistImageUseCase + + )) } } diff --git a/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift b/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift index dc9866a3e..783f96bb6 100644 --- a/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift +++ b/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift @@ -1,6 +1,8 @@ import DesignSystem import Foundation import ReactorKit +import ImageDomainInterface +import RxSwift final class DefaultPlaylistImageReactor: Reactor { enum Action { @@ -9,25 +11,28 @@ final class DefaultPlaylistImageReactor: Reactor { } enum Mutation { - case updateDataSource([String]) + case updateDataSource([DefaultImageEntity]) case updateSelectedItem(Int) case updateLoadingState(Bool) } struct State { - var dataSource: [String] + var dataSource: [DefaultImageEntity] var selectedIndex: Int var isLoading: Bool } + private let fetchDefaultPlaylistImageUseCase: any FetchDefaultPlaylistImageUseCase var initialState: State - init() { + init(fetchDefaultPlaylistImageUseCase: any FetchDefaultPlaylistImageUseCase) { initialState = State( dataSource: [], selectedIndex: 0, - isLoading: false + isLoading: true ) + + self.fetchDefaultPlaylistImageUseCase = fetchDefaultPlaylistImageUseCase } func mutate(action: Action) -> Observable { @@ -66,7 +71,11 @@ extension DefaultPlaylistImageReactor { return .concat([ .just(.updateLoadingState(true)), - .just(.updateDataSource(dataSource)), + fetchDefaultPlaylistImageUseCase.execute() + .asObservable() + .flatMap{ data -> Observable in + return Observable.just(.updateDataSource(data)) + }, .just(.updateLoadingState(false)) ]) } diff --git a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift index 280903001..6d6efbb05 100644 --- a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift +++ b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift @@ -4,6 +4,7 @@ import PlaylistFeatureInterface import SnapKit import Then import UIKit +import ImageDomainInterface final class DefaultPlaylistImageViewController: BaseReactorViewController { weak var delegate: DefaultPlaylistImageDelegate? @@ -39,12 +40,12 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController { cell, _, itemIdentifier in cell.configure(itemIdentifier) } - private lazy var thumbnailDiffableDataSource = UICollectionViewDiffableDataSource( + private lazy var thumbnailDiffableDataSource = UICollectionViewDiffableDataSource( collectionView: collectionView ) { [thumbnailCellRegistration] collectionView, indexPath, itemIdentifier in let cell = collectionView.dequeueConfiguredReusableCell( @@ -64,8 +65,6 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController() + var snapShot = NSDiffableDataSourceSnapshot() snapShot.appendSections([0]) @@ -167,7 +166,14 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController Date: Sat, 6 Jul 2024 21:40:36 +0900 Subject: [PATCH 2/8] =?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/AppComponent+Playlist.swift | 8 ++++---- .../Interface/Entity/DefaultImageEntity.swift | 7 ++----- .../Domains/ImageDomain/Sources/API/ImageAPI.swift | 4 ++-- .../DataSource/RemoteImageDataSourceImpl.swift | 4 ++-- .../Sources/Repository/ImageRepositoryImpl.swift | 2 +- .../ResponseDTO/FetchDefaultImageResponseDTO.swift | 1 - .../ResponseDTO/FetchProfileListResponseDTO.swift | 1 - .../FetchDefaultPlaylistImageUseCaseImpl.swift | 1 - Projects/Features/PlaylistFeature/Project.swift | 2 +- .../Components/DefaultPlaylistImageComponent.swift | 2 +- .../Reactors/DefaultPlaylistImageReactor.swift | 6 +++--- .../DefaultPlaylistImageViewController.swift | 11 +++++++---- .../Sources/Views/DefaultThumbnailCell.swift | 4 +--- 13 files changed, 24 insertions(+), 29 deletions(-) diff --git a/Projects/App/Sources/Application/AppComponent+Playlist.swift b/Projects/App/Sources/Application/AppComponent+Playlist.swift index 895028c55..3e337d577 100644 --- a/Projects/App/Sources/Application/AppComponent+Playlist.swift +++ b/Projects/App/Sources/Application/AppComponent+Playlist.swift @@ -1,12 +1,12 @@ import BaseFeature import BaseFeatureInterface +import ImageDomain +import ImageDomainInterface import PlaylistDomain import PlaylistDomainInterface import PlaylistFeature import PlaylistFeatureInterface import StorageFeature -import ImageDomainInterface -import ImageDomain // MARK: 변수명 주의 // AppComponent 내 변수 == Dependency 내 변수 이름 같아야함 @@ -125,10 +125,10 @@ public extension AppComponent { CheckSubscriptionUseCaseImpl(playlistRepository: playlistRepository) } } - + var fetchDefaultPlaylistImageUseCase: any FetchDefaultPlaylistImageUseCase { shared { - FetchDefaultPlaylistImageUseCaseImpl(imageRepository: imageRepository) + FetchDefaultPlaylistImageUseCaseImpl(imageRepository: imageRepository) } } } diff --git a/Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift b/Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift index 4862de68f..55003262b 100644 --- a/Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift +++ b/Projects/Domains/ImageDomain/Interface/Entity/DefaultImageEntity.swift @@ -1,14 +1,11 @@ import Foundation - -public struct DefaultImageEntity : Hashable, Equatable { - +public struct DefaultImageEntity: Hashable, Equatable { public let name: String public let url: String - + public init(name: String, url: String) { self.name = name self.url = url } - } diff --git a/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift b/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift index 1d505364a..8b2c61112 100644 --- a/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift +++ b/Projects/Domains/ImageDomain/Sources/API/ImageAPI.swift @@ -28,14 +28,14 @@ extension ImageAPI: WMAPI { public var method: Moya.Method { switch self { - case .fetchLyricDecoratingBackground, .fetchDefaultPlaylistImage , .fetchProfileList: + case .fetchLyricDecoratingBackground, .fetchDefaultPlaylistImage, .fetchProfileList: return .get } } public var task: Moya.Task { switch self { - case .fetchLyricDecoratingBackground, .fetchProfileList , .fetchDefaultPlaylistImage: + case .fetchLyricDecoratingBackground, .fetchProfileList, .fetchDefaultPlaylistImage: return .requestPlain } } diff --git a/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift b/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift index fb0c50eb2..f3775fc68 100644 --- a/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift +++ b/Projects/Domains/ImageDomain/Sources/DataSource/RemoteImageDataSourceImpl.swift @@ -15,10 +15,10 @@ public final class RemoteImageDataSourceImpl: BaseRemoteDataSource, Re .map([FetchProfileListResponseDTO].self) .map { $0.map { $0.toDomain() } } } - + public func fetchDefaultPlaylistImage() -> Single<[DefaultImageEntity]> { return request(.fetchDefaultPlaylistImage) .map([FetchDefaultImageResponseDTO].self) - .map{ $0.map{$0.toDomain()} } + .map { $0.map { $0.toDomain() } } } } diff --git a/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift b/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift index 61abf5428..e2a429da5 100644 --- a/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift +++ b/Projects/Domains/ImageDomain/Sources/Repository/ImageRepositoryImpl.swift @@ -18,7 +18,7 @@ public final class ImageRepositoryImpl: ImageRepository { public func fetchProfileList() -> Single<[ProfileListEntity]> { remoteImageDataSource.fetchProfileList() } - + public func fetchDefaultPlaylistImage() -> Single<[DefaultImageEntity]> { remoteImageDataSource.fetchDefaultPlaylistImage() } diff --git a/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift index 0a9dcbfa2..fb5df685a 100644 --- a/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift +++ b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchDefaultImageResponseDTO.swift @@ -15,4 +15,3 @@ public extension FetchDefaultImageResponseDTO { ) } } - diff --git a/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift index 297b6ab00..f18813968 100644 --- a/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift +++ b/Projects/Domains/ImageDomain/Sources/ResponseDTO/FetchProfileListResponseDTO.swift @@ -13,6 +13,5 @@ public extension FetchProfileListResponseDTO { name: name, url: url ) - } } diff --git a/Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift b/Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift index 595bc7e2f..c0dd4a064 100644 --- a/Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift +++ b/Projects/Domains/ImageDomain/Sources/UseCase/FetchDefaultPlaylistImageUseCaseImpl.swift @@ -3,7 +3,6 @@ import ImageDomainInterface import RxSwift public struct FetchDefaultPlaylistImageUseCaseImpl: FetchDefaultPlaylistImageUseCase { - private let imageRepository: any ImageRepository public init( diff --git a/Projects/Features/PlaylistFeature/Project.swift b/Projects/Features/PlaylistFeature/Project.swift index b3a2ed5f4..76e51bc0f 100644 --- a/Projects/Features/PlaylistFeature/Project.swift +++ b/Projects/Features/PlaylistFeature/Project.swift @@ -7,7 +7,7 @@ let project = Project.module( targets: [ .interface(module: .feature(.PlaylistFeature), dependencies: [ .feature(target: .BaseFeature, type: .interface), - + ]), .implements( module: .feature(.PlaylistFeature), dependencies: [ diff --git a/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift b/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift index b9945080d..a7c98a251 100644 --- a/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift +++ b/Projects/Features/PlaylistFeature/Sources/Components/DefaultPlaylistImageComponent.swift @@ -1,8 +1,8 @@ import BaseFeature import BaseFeatureInterface +import ImageDomainInterface import NeedleFoundation import PlaylistFeatureInterface -import ImageDomainInterface import UIKit public protocol DefaultPlaylistImageDependency: Dependency { diff --git a/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift b/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift index 783f96bb6..f9f17862b 100644 --- a/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift +++ b/Projects/Features/PlaylistFeature/Sources/Reactors/DefaultPlaylistImageReactor.swift @@ -1,7 +1,7 @@ import DesignSystem import Foundation -import ReactorKit import ImageDomainInterface +import ReactorKit import RxSwift final class DefaultPlaylistImageReactor: Reactor { @@ -31,7 +31,7 @@ final class DefaultPlaylistImageReactor: Reactor { selectedIndex: 0, isLoading: true ) - + self.fetchDefaultPlaylistImageUseCase = fetchDefaultPlaylistImageUseCase } @@ -73,7 +73,7 @@ extension DefaultPlaylistImageReactor { .just(.updateLoadingState(true)), fetchDefaultPlaylistImageUseCase.execute() .asObservable() - .flatMap{ data -> Observable in + .flatMap { data -> Observable in return Observable.just(.updateDataSource(data)) }, .just(.updateLoadingState(false)) diff --git a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift index 6d6efbb05..07a975ee8 100644 --- a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift +++ b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift @@ -1,10 +1,10 @@ import BaseFeature import DesignSystem +import ImageDomainInterface import PlaylistFeatureInterface import SnapKit import Then import UIKit -import ImageDomainInterface final class DefaultPlaylistImageViewController: BaseReactorViewController { weak var delegate: DefaultPlaylistImageDelegate? @@ -166,14 +166,17 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController Date: Sat, 6 Jul 2024 21:54:31 +0900 Subject: [PATCH 3/8] =?UTF-8?q?:zap:=20::=20=ED=8A=B8=EB=9E=9C=EC=A7=80?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift b/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift index 68a23d71e..daeb4cd0b 100644 --- a/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift +++ b/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift @@ -44,5 +44,5 @@ extension DefaultThumbnailCell { public func configure(_ model: DefaultImageEntity) { imageView.kf.setImage(with: URL(string: model.url), options: [.transition(.fade(0.2))]) - } + } } From 8e450620d525d06a21721b6d200899dc5212aa8d Mon Sep 17 00:00:00 2001 From: Hamp Date: Sat, 6 Jul 2024 21:54:33 +0900 Subject: [PATCH 4/8] =?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 --- .../PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift b/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift index daeb4cd0b..68a23d71e 100644 --- a/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift +++ b/Projects/Features/PlaylistFeature/Sources/Views/DefaultThumbnailCell.swift @@ -44,5 +44,5 @@ extension DefaultThumbnailCell { public func configure(_ model: DefaultImageEntity) { imageView.kf.setImage(with: URL(string: model.url), options: [.transition(.fade(0.2))]) - } + } } From d27dcf6f2875772a39cbec70affec0ec3575b847 Mon Sep 17 00:00:00 2001 From: Hamp Date: Sat, 6 Jul 2024 21:55:48 +0900 Subject: [PATCH 5/8] =?UTF-8?q?:zap:=20::=20=20=EC=9D=B8=EB=94=94=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewControllers/DefaultPlaylistImageViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift index 07a975ee8..01c79847a 100644 --- a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift +++ b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift @@ -168,7 +168,7 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController Date: Sat, 6 Jul 2024 23:04:36 +0900 Subject: [PATCH 6/8] =?UTF-8?q?:zap:=20::=20=EB=AF=B8=EB=A6=AC=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EB=A1=9C=EC=A7=81=EC=9D=84=20apply=20=EC=BB=B4?= =?UTF-8?q?=ED=94=8C=EB=A6=AC=EC=85=98=EC=9C=BC=EB=A1=9C=20=EC=98=AE?= =?UTF-8?q?=EA=B9=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DefaultPlaylistImageViewController.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift index 01c79847a..e29b4b112 100644 --- a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift +++ b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift @@ -151,6 +151,7 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController() @@ -159,7 +160,13 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController Date: Sat, 6 Jul 2024 23:04:39 +0900 Subject: [PATCH 7/8] =?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 --- .../ViewControllers/DefaultPlaylistImageViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift index e29b4b112..7379144dd 100644 --- a/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift +++ b/Projects/Features/PlaylistFeature/Sources/ViewControllers/DefaultPlaylistImageViewController.swift @@ -151,7 +151,7 @@ final class DefaultPlaylistImageViewController: BaseReactorViewController() From ed456da2d29bfb298d8ad892335e0696abb25228 Mon Sep 17 00:00:00 2001 From: Hamp Date: Sun, 7 Jul 2024 12:34:12 +0900 Subject: [PATCH 8/8] =?UTF-8?q?:zap:=20::=20=EC=BD=A4=EB=A7=88=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Features/PlaylistFeature/Project.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Features/PlaylistFeature/Project.swift b/Projects/Features/PlaylistFeature/Project.swift index 76e51bc0f..349892bed 100644 --- a/Projects/Features/PlaylistFeature/Project.swift +++ b/Projects/Features/PlaylistFeature/Project.swift @@ -6,7 +6,7 @@ let project = Project.module( name: ModulePaths.Feature.PlaylistFeature.rawValue, targets: [ .interface(module: .feature(.PlaylistFeature), dependencies: [ - .feature(target: .BaseFeature, type: .interface), + .feature(target: .BaseFeature, type: .interface) ]), .implements(