Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ”€ :: (#568) ๋‚ด์ •๋ณด ํ™”๋ฉด์„ DemoApp์œผ๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•œ Factory ์ž‘์—… ๋ฐ ๋‚ด์ •๋ณด ํ™”๋ฉด Demo #620

Merged
merged 17 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
de3a680
๐ŸŽจ :: [#568] Faq Component Interface ์„ธํŒ…
youn9k Jun 17, 2024
9c3302f
๐ŸŽจ :: [#568] Faq Domain testing ์˜์กด์„ฑ ์ถ”๊ฐ€
youn9k Jun 17, 2024
f78b9ab
โ™ป๏ธ :: [#568] Faq ViewController ์ˆ˜์ •
youn9k Jun 17, 2024
9e0da02
๐ŸŽจ :: ์ฝ”๋“œ Formatting ์ ์šฉ
youn9k Jun 17, 2024
2d52cab
Merge branch '568-stub-outer-myinfo-feature' into 568-stub-inner-myinโ€ฆ
youn9k Jun 17, 2024
617b3cd
๐ŸŽจ :: [#568] Factory ์ธํ„ฐํŽ˜์ด์Šค ์ถ”๊ฐ€
youn9k Jun 17, 2024
fcb7e11
๐ŸŽจ :: [#568] Factory ์ธํ„ฐํŽ˜์ด์Šค ์—ฐ๊ฒฐ
youn9k Jun 17, 2024
0b67e50
๐ŸŽจ :: [#568] ์˜ํ–ฅ๋ฐ›๋Š” ์ปดํฌ๋„ŒํŠธ๋“ค Factory ์ž‘์—…
youn9k Jun 17, 2024
c4f9f20
๐ŸŽจ :: ์ฝ”๋“œ Formatting ์ ์šฉ
youn9k Jun 17, 2024
48b6bd0
๐ŸŽจ :: [#568] Question Component -> Factory
youn9k Jun 17, 2024
9eeb88c
๐ŸŽจ :: ์ฝ”๋“œ Formatting ์ ์šฉ
youn9k Jun 17, 2024
022d26d
๐ŸŽจ :: [#568] ServiceInfo Component -> Factory
youn9k Jun 17, 2024
dbc2a98
๐ŸŽจ :: [#568] MyInfoStub ์ถ”๊ฐ€ ๋ฐ ํ•„์š”ํ•œ Stub ์ถ”๊ฐ€
youn9k Jun 17, 2024
89fd2ad
๐ŸŽจ :: ์ฝ”๋“œ Formatting ์ ์šฉ
youn9k Jun 17, 2024
0cf280c
๐ŸŽจ :: Demo ํƒ€๊ฒŸ์—์„œ ๊ตฌํ˜„์ฒด ์˜์กด์„ฑ ์ œ๊ฑฐ
youn9k Jun 18, 2024
c07e874
Merge branch 'develop' into 568-stub-inner-myinfo-feature
youn9k Jun 18, 2024
3ce4469
๐Ÿ’ฉ :: [#568] ๋น ์ง„ ์ฝ”๋“œ ์ถ”๊ฐ€
youn9k Jun 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Projects/App/Sources/Application/AppComponent+Base.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public extension AppComponent {
ContainSongsComponent(parent: self)
}

var privacyComponent: PrivacyComponent {
var privacyFactory: any PrivacyFactory {
PrivacyComponent(parent: self)
}

var serviceTermsComponent: ServiceTermsComponent {
var serviceTermsFactory: any ServiceTermFactory {
ServiceTermsComponent(parent: self)
}
}
21 changes: 0 additions & 21 deletions Projects/App/Sources/Application/AppComponent+Faq.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
//
// AppComponent+Search.swift
// WaktaverseMusic
//
// Created by yongbeomkwak on 2023/02/07.
// Copyright ยฉ 2023 yongbeomkwak. All rights reserved.
//

import BaseFeature
import FaqDomain
import FaqDomainInterface
import MyInfoFeature
import SignInFeature

// MARK: ๋ณ€์ˆ˜๋ช… ์ฃผ์˜
// AppComponent ๋‚ด ๋ณ€์ˆ˜ == Dependency ๋‚ด ๋ณ€์ˆ˜ ์ด๋ฆ„ ๊ฐ™์•„์•ผํ•จ

public extension AppComponent {
var questionComponent: QuestionComponent {
QuestionComponent(parent: self)
}

var faqComponent: FaqComponent {
FaqComponent(parent: self)
}

var faqContentComponent: FaqContentComponent {
FaqContentComponent(parent: self)
}

var remoteFaqDataSource: any RemoteFaqDataSource {
shared {
RemoteFaqDataSourceImpl(keychain: keychain)
Expand Down
28 changes: 24 additions & 4 deletions Projects/App/Sources/Application/AppComponent+MyInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,39 @@ import MyInfoFeature
import MyInfoFeatureInterface

extension AppComponent {
var myInfoComponent: MyInfoComponent {
var myInfoFactory: any MyInfoFactory {
MyInfoComponent(parent: self)
}

var settingComponent: SettingComponent {
var settingFactory: any SettingFactory {
SettingComponent(parent: self)
}

var teamInfoComponent: TeamInfoComponent {
var teamInfoFactory: any TeamInfoFactory {
TeamInfoComponent(parent: self)
}

var appPushSettingComponent: AppPushSettingComponent {
var appPushSettingFactory: any AppPushSettingFactory {
AppPushSettingComponent(parent: self)
}

var openSourceLicenseFactory: any OpenSourceLicenseFactory {
OpenSourceLicenseComponent(parent: self)
}

var questionFactory: any QuestionFactory {
QuestionComponent(parent: self)
}

var faqFactory: any FaqFactory {
FaqComponent(parent: self)
}

var faqContentFactory: any FaqContentFactory {
FaqContentComponent(parent: self)
}

var serviceInfoFactory: any ServiceInfoFactory {
ServiceInfoComponent(parent: self)
}
}
5 changes: 3 additions & 2 deletions Projects/App/Sources/Application/AppComponent+Notice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import BaseFeature
import MainTabFeature
import MyInfoFeature
import MyInfoFeatureInterface
import NoticeDomain
import NoticeDomainInterface
import StorageFeature
Expand All @@ -18,11 +19,11 @@ public extension AppComponent {
NoticePopupComponent(parent: self)
}

var noticeComponent: NoticeComponent {
var noticeFactory: any NoticeFactory {
NoticeComponent(parent: self)
}

var noticeDetailComponent: NoticeDetailComponent {
var noticeDetailFactory: any NoticeDetailFactory {
NoticeDetailComponent(parent: self)
}

Expand Down
8 changes: 0 additions & 8 deletions Projects/App/Sources/Application/AppComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ public extension AppComponent {

// MARK: - ETC
public extension AppComponent {
var openSourceLicenseComponent: OpenSourceLicenseComponent {
OpenSourceLicenseComponent(parent: self)
}

var serviceInfoComponent: ServiceInfoComponent {
ServiceInfoComponent(parent: self)
}

var permissionComponent: PermissionComponent {
PermissionComponent(parent: self)
}
Expand Down
4 changes: 4 additions & 0 deletions Projects/Domains/FaqDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ let project = Project.module(
.domain(target: .FaqDomain, type: .interface)
]
),
.testing(
module: .domain(.FaqDomain),
dependencies: [.domain(target: .FaqDomain, type: .interface)]
),
.tests(
module: .domain(.FaqDomain),
dependencies: [.domain(target: .FaqDomain)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// FetchArtistListUseCaseImpl.swift
// DataModule
//
// Created by KTH on 2023/02/08.
// Copyright ยฉ 2023 yongbeomkwak. All rights reserved.
//

import FaqDomainInterface
import Foundation
import RxSwift
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// FetchArtistListUseCaseImpl.swift
// DataModule
//
// Created by KTH on 2023/02/08.
// Copyright ยฉ 2023 yongbeomkwak. All rights reserved.
//

import FaqDomainInterface
import Foundation
import RxSwift
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import FaqDomainInterface
import Foundation
import RxSwift

public struct FetchFaqCategoriesUseCaseStub: FetchFaqCategoriesUseCase {
public func execute() -> Single<FaqCategoryEntity> {
return .just(FaqCategoryEntity(categories: []))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import FaqDomainInterface
import Foundation
import RxSwift

public struct FetchFaqUseCaseStub: FetchFaqUseCase {
public func execute() -> Single<[FaqEntity]> {
return .just([])
}
}
4 changes: 4 additions & 0 deletions Projects/Domains/NoticeDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ let project = Project.module(
.domain(target: .NoticeDomain, type: .interface)
]
),
.testing(
module: .domain(.NoticeDomain),
dependencies: [.domain(target: .NoticeDomain, type: .interface)]
),
.tests(
module: .domain(.NoticeDomain),
dependencies: [.domain(target: .NoticeDomain)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// FetchNoticeCategoriesUseCaseImpl.swift
// DataModule
//
// Created by KTH on 2023/04/08.
// Copyright ยฉ 2023 yongbeomkwak. All rights reserved.
//

import Foundation
import NoticeDomainInterface
import RxSwift
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// FetchNoticeUseCaseImpl.swift
// DataModule
//
// Created by KTH on 2023/04/08.
// Copyright ยฉ 2023 yongbeomkwak. All rights reserved.
//

import Foundation
import NoticeDomainInterface
import RxSwift
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation
import NoticeDomainInterface
import RxSwift

public struct FetchNoticeCategoriesUseCaseStub: FetchNoticeCategoriesUseCase {
public func execute() -> Single<FetchNoticeCategoriesEntity> {
return .just(FetchNoticeCategoriesEntity(categories: []))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation
import NoticeDomainInterface
import RxSwift

public struct FetchNoticeUseCaseStub: FetchNoticeUseCase {
public func execute(type: NoticeType) -> Single<[FetchNoticeEntity]> {
return .just([])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ChartFeature
import Foundation
import HomeFeature
import MyInfoFeature
import MyInfoFeatureInterface
import NeedleFoundation
import NoticeDomainInterface
import SearchFeature
Expand All @@ -18,10 +19,10 @@ public protocol MainTabBarDependency: Dependency {
var searchFactory: any SearchFactory { get }
var artistComponent: ArtistComponent { get }
var storageFactory: any StorageFactory { get }
var myInfoComponent: MyInfoComponent { get }
var myInfoFactory: any MyInfoFactory { get }
var noticePopupComponent: NoticePopupComponent { get }
var noticeComponent: NoticeComponent { get }
var noticeDetailComponent: NoticeDetailComponent { get }
var noticeFactory: any NoticeFactory { get }
var noticeDetailFactory: any NoticeDetailFactory { get }
}

public final class MainTabBarComponent: Component<MainTabBarDependency> {
Expand All @@ -35,10 +36,10 @@ public final class MainTabBarComponent: Component<MainTabBarDependency> {
searchFactory: self.dependency.searchFactory,
artistComponent: self.dependency.artistComponent,
storageFactory: self.dependency.storageFactory,
myInfoComponent: self.dependency.myInfoComponent,
myInfoFactory: self.dependency.myInfoFactory,
noticePopupComponent: self.dependency.noticePopupComponent,
noticeComponent: self.dependency.noticeComponent,
noticeDetailComponent: self.dependency.noticeDetailComponent
noticeFactory: self.dependency.noticeFactory,
noticeDetailFactory: self.dependency.noticeDetailFactory
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ChartFeature
import DesignSystem
import HomeFeature
import MyInfoFeature
import MyInfoFeatureInterface
import NoticeDomainInterface
import RxCocoa
import RxSwift
Expand All @@ -26,7 +27,7 @@ public final class MainTabBarViewController: BaseViewController, ViewControllerF
searchFactory.makeView().wrapNavigationController,
artistComponent.makeView().wrapNavigationController,
storageFactory.makeView().wrapNavigationController,
myInfoComponent.makeView().wrapNavigationController
myInfoFactory.makeView().wrapNavigationController
]
}()

Expand All @@ -43,10 +44,10 @@ public final class MainTabBarViewController: BaseViewController, ViewControllerF
private var searchFactory: SearchFactory!
private var artistComponent: ArtistComponent!
private var storageFactory: StorageFactory!
private var myInfoComponent: MyInfoComponent!
private var myInfoFactory: MyInfoFactory!
private var noticePopupComponent: NoticePopupComponent!
private var noticeComponent: NoticeComponent!
private var noticeDetailComponent: NoticeDetailComponent!
private var noticeFactory: NoticeFactory!
private var noticeDetailFactory: NoticeDetailFactory!

override public func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -72,10 +73,10 @@ public final class MainTabBarViewController: BaseViewController, ViewControllerF
searchFactory: SearchFactory,
artistComponent: ArtistComponent,
storageFactory: StorageFactory,
myInfoComponent: MyInfoComponent,
myInfoFactory: MyInfoFactory,
noticePopupComponent: NoticePopupComponent,
noticeComponent: NoticeComponent,
noticeDetailComponent: NoticeDetailComponent
noticeFactory: NoticeFactory,
noticeDetailFactory: NoticeDetailFactory
) -> MainTabBarViewController {
let viewController = MainTabBarViewController.viewController(storyBoardName: "Main", bundle: Bundle.module)
viewController.viewModel = viewModel
Expand All @@ -84,10 +85,10 @@ public final class MainTabBarViewController: BaseViewController, ViewControllerF
viewController.searchFactory = searchFactory
viewController.artistComponent = artistComponent
viewController.storageFactory = storageFactory
viewController.myInfoComponent = myInfoComponent
viewController.myInfoFactory = myInfoFactory
viewController.noticePopupComponent = noticePopupComponent
viewController.noticeComponent = noticeComponent
viewController.noticeDetailComponent = noticeDetailComponent
viewController.noticeFactory = noticeFactory
viewController.noticeDetailFactory = noticeDetailFactory
return viewController
}
}
Expand Down Expand Up @@ -148,7 +149,7 @@ extension MainTabBarViewController {
extension MainTabBarViewController: NoticePopupViewControllerDelegate {
public func noticeTapped(model: FetchNoticeEntity) {
if model.thumbnail.link.isEmpty {
let viewController = noticeDetailComponent.makeView(model: model)
let viewController = noticeDetailFactory.makeView(model: model)
viewController.modalPresentationStyle = .overFullScreen
present(viewController, animated: true)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Inject
@testable import MyInfoFeature
@testable import MyInfoFeatureTesting
import UIKit

@main
Expand All @@ -12,9 +12,9 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)

let reactor = MyInfoReactor()
let vc = MyInfoComponentStub()
let viewController = Inject.ViewControllerHost(
UINavigationController(rootViewController: MyInfoViewController(reactor: reactor))
UINavigationController(rootViewController: vc.makeView())
)
window?.rootViewController = viewController
window?.makeKeyAndVisible()
Expand Down
30 changes: 30 additions & 0 deletions Projects/Features/MyInfoFeature/Interface/Interface.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import FaqDomainInterface
import NoticeDomainInterface
import UIKit

public protocol MyInfoFactory {
Expand All @@ -15,3 +17,31 @@ public protocol AppPushSettingFactory {
public protocol OpenSourceLicenseFactory {
func makeView() -> UIViewController
}

public protocol FaqFactory {
func makeView() -> UIViewController
}

public protocol FaqContentFactory {
func makeView(dataSource: [FaqEntity]) -> UIViewController
}

public protocol NoticeFactory {
func makeView() -> UIViewController
}

public protocol NoticeDetailFactory {
func makeView(model: FetchNoticeEntity) -> UIViewController
}

public protocol QuestionFactory {
func makeView() -> UIViewController
}

public protocol TeamInfoFactory {
func makeView() -> UIViewController
}

public protocol ServiceInfoFactory {
func makeView() -> UIViewController
}
Loading
Loading