From c0bed426de79a17efe50ed60dac113a0081c2e89 Mon Sep 17 00:00:00 2001 From: KTH Date: Sun, 10 Mar 2024 23:20:06 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20::=20[#437]=20FaqDomain=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=9E=91=EC=97=85=20=EC=99=84=EB=A3=8C=20=EB=B0=8F?= =?UTF-8?q?=20=EB=A0=88=EA=B1=B0=EC=8B=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Sources/Application/AppComponent+Faq.swift | 4 ++-- .../App/Sources/Application/NeedleGenerated.swift | 2 ++ .../Sources/Repository/ChartRepositoryImpl.swift | 2 +- .../DataSource}/RemoteFaqDataSource.swift | 3 --- .../Interface}/Entity/FaqCategoryEntity.swift | 0 .../FaqDomain/Interface}/Entity/FaqEntity.swift | 0 .../Domains/FaqDomain/Interface/Interface.swift | 1 - .../Interface}/Repository/FaqRepository.swift | 2 -- .../UseCase/FetchFaqCategoriesUseCase.swift | 1 - .../Interface}/UseCase/FetchFaqUseCase.swift | 1 - .../FaqDomain}/Sources/API/FaqAPI.swift | 2 +- .../DataSource}/RemoteFaqDataSourceImpl.swift | 6 ++---- .../Sources/Repository}/FaqRepositoryImpl.swift | 8 ++------ .../ResponseDTO/FaqCategoryResponseDTO.swift} | 9 ++++++--- .../Sources/ResponseDTO}/FaqResponseDTO.swift | 12 ++++++++++++ Projects/Domains/FaqDomain/Sources/Sources.swift | 1 - .../UseCase}/FetchFaqCategoriesUseCaseImpl.swift | 4 +--- .../Sources/UseCase}/FetchFaqUseCaseImpl.swift | 4 +--- .../Sources/Components/FaqComponent.swift | 2 +- .../Sources/Components/FaqContentComponent.swift | 2 +- .../Sources/ViewModels/FaqViewModel.swift | 2 +- .../Sources/ViewModels/QnaContentViewModel.swift | 2 +- .../Sources/Views/AnswerTableViewCell.swift | 2 +- .../Sources/Views/QuestionTableViewCell.swift | 2 +- .../Faq/Response/FaqCategoryResponseDTO.swift | 5 ----- .../Faq/DataTransfer/FetchQnaTransfer.swift | 14 -------------- 26 files changed, 36 insertions(+), 57 deletions(-) rename Projects/{Services/NetworkModule/Sources/Faq/Remote => Domains/FaqDomain/Interface/DataSource}/RemoteFaqDataSource.swift (72%) rename Projects/{Services/DomainModule/Sources/Faq => Domains/FaqDomain/Interface}/Entity/FaqCategoryEntity.swift (100%) rename Projects/{Services/DomainModule/Sources/Faq => Domains/FaqDomain/Interface}/Entity/FaqEntity.swift (100%) delete mode 100644 Projects/Domains/FaqDomain/Interface/Interface.swift rename Projects/{Services/DomainModule/Sources/Faq => Domains/FaqDomain/Interface}/Repository/FaqRepository.swift (87%) rename Projects/{Services/DomainModule/Sources/Faq => Domains/FaqDomain/Interface}/UseCase/FetchFaqCategoriesUseCase.swift (91%) rename Projects/{Services/DomainModule/Sources/Faq => Domains/FaqDomain/Interface}/UseCase/FetchFaqUseCase.swift (91%) rename Projects/{Services/APIKit => Domains/FaqDomain}/Sources/API/FaqAPI.swift (97%) rename Projects/{Services/NetworkModule/Sources/Faq/Remote => Domains/FaqDomain/Sources/DataSource}/RemoteFaqDataSourceImpl.swift (86%) rename Projects/{Services/DataModule/Sources/Faq/Repositories => Domains/FaqDomain/Sources/Repository}/FaqRepositoryImpl.swift (78%) rename Projects/{Services/NetworkModule/Sources/Faq/DataTransfer/FetchCategoriesTransfer.swift => Domains/FaqDomain/Sources/ResponseDTO/FaqCategoryResponseDTO.swift} (53%) rename Projects/{Services/DataMappingModule/Sources/Faq/Response => Domains/FaqDomain/Sources/ResponseDTO}/FaqResponseDTO.swift (60%) delete mode 100644 Projects/Domains/FaqDomain/Sources/Sources.swift rename Projects/{Services/DataModule/Sources/Faq/UseCases => Domains/FaqDomain/Sources/UseCase}/FetchFaqCategoriesUseCaseImpl.swift (89%) rename Projects/{Services/DataModule/Sources/Faq/UseCases => Domains/FaqDomain/Sources/UseCase}/FetchFaqUseCaseImpl.swift (88%) delete mode 100644 Projects/Services/DataMappingModule/Sources/Faq/Response/FaqCategoryResponseDTO.swift delete mode 100644 Projects/Services/NetworkModule/Sources/Faq/DataTransfer/FetchQnaTransfer.swift diff --git a/Projects/App/Sources/Application/AppComponent+Faq.swift b/Projects/App/Sources/Application/AppComponent+Faq.swift index 862427091..06f9ef186 100644 --- a/Projects/App/Sources/Application/AppComponent+Faq.swift +++ b/Projects/App/Sources/Application/AppComponent+Faq.swift @@ -7,11 +7,11 @@ // import CommonFeature -import DataModule -import DomainModule import NetworkModule import SignInFeature import StorageFeature +import FaqDomain +import FaqDomainInterface // MARK: 변수명 주의 // AppComponent 내 변수 == Dependency 내 변수 이름 같아야함 diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index e9d73e118..f50ba8752 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -16,6 +16,8 @@ import DataMappingModule import DataModule import DesignSystem import DomainModule +import FaqDomain +import FaqDomainInterface import Foundation import HomeFeature import KeychainModule diff --git a/Projects/Domains/ChartDomain/Sources/Repository/ChartRepositoryImpl.swift b/Projects/Domains/ChartDomain/Sources/Repository/ChartRepositoryImpl.swift index a341c63de..5ab828c9e 100644 --- a/Projects/Domains/ChartDomain/Sources/Repository/ChartRepositoryImpl.swift +++ b/Projects/Domains/ChartDomain/Sources/Repository/ChartRepositoryImpl.swift @@ -2,7 +2,7 @@ import Foundation import RxSwift import ChartDomainInterface -public struct ChartRepositoryImpl: ChartRepository { +public final class ChartRepositoryImpl: ChartRepository { private let remoteChartDataSource: any RemoteChartDataSource public init( diff --git a/Projects/Services/NetworkModule/Sources/Faq/Remote/RemoteFaqDataSource.swift b/Projects/Domains/FaqDomain/Interface/DataSource/RemoteFaqDataSource.swift similarity index 72% rename from Projects/Services/NetworkModule/Sources/Faq/Remote/RemoteFaqDataSource.swift rename to Projects/Domains/FaqDomain/Interface/DataSource/RemoteFaqDataSource.swift index 0bec14640..bd5ef8d31 100644 --- a/Projects/Services/NetworkModule/Sources/Faq/Remote/RemoteFaqDataSource.swift +++ b/Projects/Domains/FaqDomain/Interface/DataSource/RemoteFaqDataSource.swift @@ -1,6 +1,3 @@ -import DataMappingModule -import DomainModule -import ErrorModule import Foundation import RxSwift diff --git a/Projects/Services/DomainModule/Sources/Faq/Entity/FaqCategoryEntity.swift b/Projects/Domains/FaqDomain/Interface/Entity/FaqCategoryEntity.swift similarity index 100% rename from Projects/Services/DomainModule/Sources/Faq/Entity/FaqCategoryEntity.swift rename to Projects/Domains/FaqDomain/Interface/Entity/FaqCategoryEntity.swift diff --git a/Projects/Services/DomainModule/Sources/Faq/Entity/FaqEntity.swift b/Projects/Domains/FaqDomain/Interface/Entity/FaqEntity.swift similarity index 100% rename from Projects/Services/DomainModule/Sources/Faq/Entity/FaqEntity.swift rename to Projects/Domains/FaqDomain/Interface/Entity/FaqEntity.swift diff --git a/Projects/Domains/FaqDomain/Interface/Interface.swift b/Projects/Domains/FaqDomain/Interface/Interface.swift deleted file mode 100644 index b1853ce60..000000000 --- a/Projects/Domains/FaqDomain/Interface/Interface.swift +++ /dev/null @@ -1 +0,0 @@ -// This is for Tuist diff --git a/Projects/Services/DomainModule/Sources/Faq/Repository/FaqRepository.swift b/Projects/Domains/FaqDomain/Interface/Repository/FaqRepository.swift similarity index 87% rename from Projects/Services/DomainModule/Sources/Faq/Repository/FaqRepository.swift rename to Projects/Domains/FaqDomain/Interface/Repository/FaqRepository.swift index de3ba4f75..d1d223ac8 100644 --- a/Projects/Services/DomainModule/Sources/Faq/Repository/FaqRepository.swift +++ b/Projects/Domains/FaqDomain/Interface/Repository/FaqRepository.swift @@ -6,8 +6,6 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DataMappingModule -import ErrorModule import Foundation import RxSwift diff --git a/Projects/Services/DomainModule/Sources/Faq/UseCase/FetchFaqCategoriesUseCase.swift b/Projects/Domains/FaqDomain/Interface/UseCase/FetchFaqCategoriesUseCase.swift similarity index 91% rename from Projects/Services/DomainModule/Sources/Faq/UseCase/FetchFaqCategoriesUseCase.swift rename to Projects/Domains/FaqDomain/Interface/UseCase/FetchFaqCategoriesUseCase.swift index a825c7a67..56b863ece 100644 --- a/Projects/Services/DomainModule/Sources/Faq/UseCase/FetchFaqCategoriesUseCase.swift +++ b/Projects/Domains/FaqDomain/Interface/UseCase/FetchFaqCategoriesUseCase.swift @@ -6,7 +6,6 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DataMappingModule import Foundation import RxSwift diff --git a/Projects/Services/DomainModule/Sources/Faq/UseCase/FetchFaqUseCase.swift b/Projects/Domains/FaqDomain/Interface/UseCase/FetchFaqUseCase.swift similarity index 91% rename from Projects/Services/DomainModule/Sources/Faq/UseCase/FetchFaqUseCase.swift rename to Projects/Domains/FaqDomain/Interface/UseCase/FetchFaqUseCase.swift index c1c173f7c..34ffb4b27 100644 --- a/Projects/Services/DomainModule/Sources/Faq/UseCase/FetchFaqUseCase.swift +++ b/Projects/Domains/FaqDomain/Interface/UseCase/FetchFaqUseCase.swift @@ -6,7 +6,6 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DataMappingModule import Foundation import RxSwift diff --git a/Projects/Services/APIKit/Sources/API/FaqAPI.swift b/Projects/Domains/FaqDomain/Sources/API/FaqAPI.swift similarity index 97% rename from Projects/Services/APIKit/Sources/API/FaqAPI.swift rename to Projects/Domains/FaqDomain/Sources/API/FaqAPI.swift index 30f403c25..35af607ef 100644 --- a/Projects/Services/APIKit/Sources/API/FaqAPI.swift +++ b/Projects/Domains/FaqDomain/Sources/API/FaqAPI.swift @@ -1,8 +1,8 @@ -import DataMappingModule import ErrorModule import Foundation import KeychainModule import Moya +import BaseDomain public enum FaqAPI { case fetchFaqCategories diff --git a/Projects/Services/NetworkModule/Sources/Faq/Remote/RemoteFaqDataSourceImpl.swift b/Projects/Domains/FaqDomain/Sources/DataSource/RemoteFaqDataSourceImpl.swift similarity index 86% rename from Projects/Services/NetworkModule/Sources/Faq/Remote/RemoteFaqDataSourceImpl.swift rename to Projects/Domains/FaqDomain/Sources/DataSource/RemoteFaqDataSourceImpl.swift index 0cb0861db..c9efb1ebc 100644 --- a/Projects/Services/NetworkModule/Sources/Faq/Remote/RemoteFaqDataSourceImpl.swift +++ b/Projects/Domains/FaqDomain/Sources/DataSource/RemoteFaqDataSourceImpl.swift @@ -1,9 +1,7 @@ -import APIKit -import DataMappingModule -import DomainModule -import ErrorModule import Foundation import RxSwift +import BaseDomain +import FaqDomainInterface public final class RemoteFaqDataSourceImpl: BaseRemoteDataSource, RemoteFaqDataSource { public func fetchCategories() -> Single { diff --git a/Projects/Services/DataModule/Sources/Faq/Repositories/FaqRepositoryImpl.swift b/Projects/Domains/FaqDomain/Sources/Repository/FaqRepositoryImpl.swift similarity index 78% rename from Projects/Services/DataModule/Sources/Faq/Repositories/FaqRepositoryImpl.swift rename to Projects/Domains/FaqDomain/Sources/Repository/FaqRepositoryImpl.swift index 8b7c78bab..9505b2010 100644 --- a/Projects/Services/DataModule/Sources/Faq/Repositories/FaqRepositoryImpl.swift +++ b/Projects/Domains/FaqDomain/Sources/Repository/FaqRepositoryImpl.swift @@ -6,14 +6,10 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DatabaseModule -import DataMappingModule -import DomainModule -import ErrorModule -import NetworkModule +import FaqDomainInterface import RxSwift -public struct FaqRepositoryImpl: FaqRepository { +public final class FaqRepositoryImpl: FaqRepository { private let remoteFaqDataSource: any RemoteFaqDataSource public init( diff --git a/Projects/Services/NetworkModule/Sources/Faq/DataTransfer/FetchCategoriesTransfer.swift b/Projects/Domains/FaqDomain/Sources/ResponseDTO/FaqCategoryResponseDTO.swift similarity index 53% rename from Projects/Services/NetworkModule/Sources/Faq/DataTransfer/FetchCategoriesTransfer.swift rename to Projects/Domains/FaqDomain/Sources/ResponseDTO/FaqCategoryResponseDTO.swift index c01c89161..8d8248006 100644 --- a/Projects/Services/NetworkModule/Sources/Faq/DataTransfer/FetchCategoriesTransfer.swift +++ b/Projects/Domains/FaqDomain/Sources/ResponseDTO/FaqCategoryResponseDTO.swift @@ -1,6 +1,9 @@ -import DataMappingModule -import DomainModule -import Utility +import Foundation +import FaqDomainInterface + +public struct FaqCategoryResponseDTO: Decodable, Equatable { + public let categories: [String] +} public extension FaqCategoryResponseDTO { func toDomain() -> FaqCategoryEntity { diff --git a/Projects/Services/DataMappingModule/Sources/Faq/Response/FaqResponseDTO.swift b/Projects/Domains/FaqDomain/Sources/ResponseDTO/FaqResponseDTO.swift similarity index 60% rename from Projects/Services/DataMappingModule/Sources/Faq/Response/FaqResponseDTO.swift rename to Projects/Domains/FaqDomain/Sources/ResponseDTO/FaqResponseDTO.swift index 70c9c67dd..0a3dd47f8 100644 --- a/Projects/Services/DataMappingModule/Sources/Faq/Response/FaqResponseDTO.swift +++ b/Projects/Domains/FaqDomain/Sources/ResponseDTO/FaqResponseDTO.swift @@ -7,6 +7,7 @@ // import Foundation +import FaqDomainInterface public struct FaqResponseDTO: Decodable { public let question, description: String @@ -16,3 +17,14 @@ public struct FaqResponseDTO: Decodable { case question, description, category } } + +public extension FaqResponseDTO { + func toDomain() -> FaqEntity { + FaqEntity( + category: category, + question: question, + description: description, + isOpen: false + ) + } +} diff --git a/Projects/Domains/FaqDomain/Sources/Sources.swift b/Projects/Domains/FaqDomain/Sources/Sources.swift deleted file mode 100644 index b1853ce60..000000000 --- a/Projects/Domains/FaqDomain/Sources/Sources.swift +++ /dev/null @@ -1 +0,0 @@ -// This is for Tuist diff --git a/Projects/Services/DataModule/Sources/Faq/UseCases/FetchFaqCategoriesUseCaseImpl.swift b/Projects/Domains/FaqDomain/Sources/UseCase/FetchFaqCategoriesUseCaseImpl.swift similarity index 89% rename from Projects/Services/DataModule/Sources/Faq/UseCases/FetchFaqCategoriesUseCaseImpl.swift rename to Projects/Domains/FaqDomain/Sources/UseCase/FetchFaqCategoriesUseCaseImpl.swift index 9400d364f..5cb244e15 100644 --- a/Projects/Services/DataModule/Sources/Faq/UseCases/FetchFaqCategoriesUseCaseImpl.swift +++ b/Projects/Domains/FaqDomain/Sources/UseCase/FetchFaqCategoriesUseCaseImpl.swift @@ -6,10 +6,8 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DataMappingModule -import DomainModule -import ErrorModule import Foundation +import FaqDomainInterface import RxSwift public struct FetchFaqCategoriesUseCaseImpl: FetchFaqCategoriesUseCase { diff --git a/Projects/Services/DataModule/Sources/Faq/UseCases/FetchFaqUseCaseImpl.swift b/Projects/Domains/FaqDomain/Sources/UseCase/FetchFaqUseCaseImpl.swift similarity index 88% rename from Projects/Services/DataModule/Sources/Faq/UseCases/FetchFaqUseCaseImpl.swift rename to Projects/Domains/FaqDomain/Sources/UseCase/FetchFaqUseCaseImpl.swift index 0da42c62c..7c84ca276 100644 --- a/Projects/Services/DataModule/Sources/Faq/UseCases/FetchFaqUseCaseImpl.swift +++ b/Projects/Domains/FaqDomain/Sources/UseCase/FetchFaqUseCaseImpl.swift @@ -6,10 +6,8 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DataMappingModule -import DomainModule -import ErrorModule import Foundation +import FaqDomainInterface import RxSwift public struct FetchFaqUseCaseImpl: FetchFaqUseCase { diff --git a/Projects/Features/StorageFeature/Sources/Components/FaqComponent.swift b/Projects/Features/StorageFeature/Sources/Components/FaqComponent.swift index 7d8df7eaf..9f56c2811 100644 --- a/Projects/Features/StorageFeature/Sources/Components/FaqComponent.swift +++ b/Projects/Features/StorageFeature/Sources/Components/FaqComponent.swift @@ -6,7 +6,7 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DomainModule +import FaqDomainInterface import Foundation import NeedleFoundation diff --git a/Projects/Features/StorageFeature/Sources/Components/FaqContentComponent.swift b/Projects/Features/StorageFeature/Sources/Components/FaqContentComponent.swift index 7fcd717a7..9318bbd4a 100644 --- a/Projects/Features/StorageFeature/Sources/Components/FaqContentComponent.swift +++ b/Projects/Features/StorageFeature/Sources/Components/FaqContentComponent.swift @@ -6,7 +6,7 @@ // Copyright © 2023 yongbeomkwak. All rights reserved. // -import DomainModule +import FaqDomainInterface import Foundation import NeedleFoundation diff --git a/Projects/Features/StorageFeature/Sources/ViewModels/FaqViewModel.swift b/Projects/Features/StorageFeature/Sources/ViewModels/FaqViewModel.swift index f079f48c4..4f4a7c7ef 100644 --- a/Projects/Features/StorageFeature/Sources/ViewModels/FaqViewModel.swift +++ b/Projects/Features/StorageFeature/Sources/ViewModels/FaqViewModel.swift @@ -7,7 +7,7 @@ // import BaseFeature -import DomainModule +import FaqDomainInterface import Foundation import KeychainModule import RxRelay diff --git a/Projects/Features/StorageFeature/Sources/ViewModels/QnaContentViewModel.swift b/Projects/Features/StorageFeature/Sources/ViewModels/QnaContentViewModel.swift index 651ddb90f..7acd1e929 100644 --- a/Projects/Features/StorageFeature/Sources/ViewModels/QnaContentViewModel.swift +++ b/Projects/Features/StorageFeature/Sources/ViewModels/QnaContentViewModel.swift @@ -7,12 +7,12 @@ // import BaseFeature -import DomainModule import Foundation import KeychainModule import RxRelay import RxSwift import Utility +import FaqDomainInterface public final class QnaContentViewModel: ViewModelType { var disposeBag = DisposeBag() diff --git a/Projects/Features/StorageFeature/Sources/Views/AnswerTableViewCell.swift b/Projects/Features/StorageFeature/Sources/Views/AnswerTableViewCell.swift index 94c6c211f..96288bf20 100644 --- a/Projects/Features/StorageFeature/Sources/Views/AnswerTableViewCell.swift +++ b/Projects/Features/StorageFeature/Sources/Views/AnswerTableViewCell.swift @@ -7,7 +7,7 @@ // import DesignSystem -import DomainModule +import FaqDomainInterface import UIKit class AnswerTableViewCell: UITableViewCell { diff --git a/Projects/Features/StorageFeature/Sources/Views/QuestionTableViewCell.swift b/Projects/Features/StorageFeature/Sources/Views/QuestionTableViewCell.swift index 07b82af2c..116445818 100644 --- a/Projects/Features/StorageFeature/Sources/Views/QuestionTableViewCell.swift +++ b/Projects/Features/StorageFeature/Sources/Views/QuestionTableViewCell.swift @@ -7,7 +7,7 @@ // import DesignSystem -import DomainModule +import FaqDomainInterface import UIKit class QuestionTableViewCell: UITableViewCell { diff --git a/Projects/Services/DataMappingModule/Sources/Faq/Response/FaqCategoryResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Faq/Response/FaqCategoryResponseDTO.swift deleted file mode 100644 index b12aebe5c..000000000 --- a/Projects/Services/DataMappingModule/Sources/Faq/Response/FaqCategoryResponseDTO.swift +++ /dev/null @@ -1,5 +0,0 @@ -import Foundation - -public struct FaqCategoryResponseDTO: Codable, Equatable { - public let categories: [String] -} diff --git a/Projects/Services/NetworkModule/Sources/Faq/DataTransfer/FetchQnaTransfer.swift b/Projects/Services/NetworkModule/Sources/Faq/DataTransfer/FetchQnaTransfer.swift deleted file mode 100644 index 9c1f29865..000000000 --- a/Projects/Services/NetworkModule/Sources/Faq/DataTransfer/FetchQnaTransfer.swift +++ /dev/null @@ -1,14 +0,0 @@ -import DataMappingModule -import DomainModule -import Utility - -public extension FaqResponseDTO { - func toDomain() -> FaqEntity { - FaqEntity( - category: category, - question: question, - description: description, - isOpen: false - ) - } -}