-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #430 from wakmusic/feature/425-setting-appdomain
π :: (#425) AppDomain λͺ¨λ μμ
- Loading branch information
Showing
34 changed files
with
286 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Projects/Domains/AppDomain/Interface/DataSource/RemoteAppDataSource.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// RemoteAppDataSource.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import RxSwift | ||
|
||
public protocol RemoteAppDataSource { | ||
func fetchAppCheck() -> Single<AppCheckEntity> | ||
} |
20 changes: 9 additions & 11 deletions
20
...le/Sources/App/Entity/AppInfoEntity.swift β ...ain/Interface/Entity/AppCheckEntity.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
// | ||
// VersionCheckEntity.swift | ||
// DomainModuleTests | ||
// AppCheckEntity.swift | ||
// AppDomain | ||
// | ||
// Created by yongbeomkwak on 2023/05/23. | ||
// Copyright Β© 2023 yongbeomkwak. All rights reserved. | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import DataMappingModule | ||
|
||
public struct AppInfoEntity: Equatable { | ||
public struct AppCheckEntity: Equatable { | ||
public init( | ||
flag: AppInfoFlagType, | ||
flag: AppCheckFlagType, | ||
title: String, | ||
description: String, | ||
version: String, | ||
specialLogo: Bool | ||
) | ||
{ | ||
) { | ||
self.flag = flag | ||
self.title = title | ||
self.description = description | ||
self.version = version | ||
self.specialLogo = specialLogo | ||
} | ||
public let flag: AppInfoFlagType | ||
|
||
public let flag: AppCheckFlagType | ||
public let title, description, version: String | ||
public let specialLogo: Bool | ||
} |
17 changes: 17 additions & 0 deletions
17
Projects/Domains/AppDomain/Interface/Enum/AppCheckFlagType.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// AppCheckFlagType.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum AppCheckFlagType: Int, Decodable { | ||
case normal = 1 | ||
case event | ||
case update | ||
case forceUpdate | ||
case offline | ||
} |
14 changes: 14 additions & 0 deletions
14
Projects/Domains/AppDomain/Interface/Repository/AppRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// AppRepository.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import RxSwift | ||
|
||
public protocol AppRepository { | ||
func fetchAppCheck() -> Single<AppCheckEntity> | ||
} |
14 changes: 14 additions & 0 deletions
14
Projects/Domains/AppDomain/Interface/UseCase/FetchAppCheckUseCase.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// FetchAppCheckUseCase.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import RxSwift | ||
|
||
public protocol FetchAppCheckUseCase { | ||
func execute() -> Single<AppCheckEntity> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import ProjectDescription | ||
import ProjectDescriptionHelpers | ||
import DependencyPlugin | ||
|
||
let project = Project.module( | ||
name: ModulePaths.Domain.AppDomain.rawValue, | ||
targets: [ | ||
.implements( | ||
module: .domain(.AppDomain), | ||
product: .staticFramework, | ||
dependencies: [ | ||
TargetDependency.domain(target: .BaseDomain), | ||
TargetDependency.domain(target: .AppDomain, type: .interface) | ||
] | ||
), | ||
.interface(module: .domain(.AppDomain)), | ||
.tests( | ||
module: .domain(.AppDomain), | ||
dependencies: [.domain(target: .AppDomain)] | ||
) | ||
] | ||
) |
41 changes: 25 additions & 16 deletions
41
.../Services/APIKit/Sources/API/AppAPI.swift β ...ins/AppDomain/Sources/AppAPI/AppAPI.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Projects/Domains/AppDomain/Sources/DataSource/RemoteAppDataSourceImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// RemoteAppDataSourceImpl.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import BaseDomain | ||
import AppDomainInterface | ||
import RxSwift | ||
|
||
public final class RemoteAppDataSourceImpl: BaseRemoteDataSource<AppAPI>, RemoteAppDataSource { | ||
public func fetchAppCheck() -> Single<AppCheckEntity> { | ||
request(.fetchAppCheck) | ||
.map(FetchAppCheckResponseDTO.self) | ||
.map { $0.toDomain() } | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Projects/Domains/AppDomain/Sources/Repository/AppRepositoryImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// AppRepositoryImpl.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import AppDomainInterface | ||
import RxSwift | ||
|
||
public final class AppRepositoryImpl: AppRepository { | ||
private let remoteAppDataSource: any RemoteAppDataSource | ||
|
||
public init( | ||
remoteAppDataSource: RemoteAppDataSource | ||
) { | ||
self.remoteAppDataSource = remoteAppDataSource | ||
} | ||
|
||
public func fetchAppCheck() -> Single<AppCheckEntity> { | ||
remoteAppDataSource.fetchAppCheck() | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
Projects/Domains/AppDomain/Sources/ResponseDTO/FetchAppCheckResponseDTO.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// AppCheckResponseDTO.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import AppDomainInterface | ||
|
||
public struct FetchAppCheckResponseDTO: Decodable { | ||
public let flag: AppCheckFlagType | ||
public let title, description, version: String? | ||
public let specialLogo: Bool? | ||
} | ||
|
||
public extension FetchAppCheckResponseDTO { | ||
func toDomain() -> AppCheckEntity { | ||
return AppCheckEntity( | ||
flag: flag, | ||
title: title ?? "", | ||
description: description ?? "", | ||
version: version ?? "", | ||
specialLogo: specialLogo ?? false | ||
) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Projects/Domains/AppDomain/Sources/UseCase/FetchAppCheckUseCaseImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// FetchCheckAppUseCaseImpl.swift | ||
// AppDomain | ||
// | ||
// Created by KTH on 2024/03/04. | ||
// Copyright Β© 2024 yongbeomkwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import RxSwift | ||
import AppDomainInterface | ||
|
||
public struct FetchAppCheckUseCaseImpl: FetchAppCheckUseCase { | ||
private let appRepository: any AppRepository | ||
|
||
public init( | ||
appRepository: AppRepository | ||
) { | ||
self.appRepository = appRepository | ||
} | ||
|
||
public func execute() -> Single<AppCheckEntity> { | ||
appRepository.fetchAppCheck() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
Oops, something went wrong.