-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…eature 🔗 :: (#262) 미완성 기능 구현 및 버그 수정
- Loading branch information
Showing
42 changed files
with
864 additions
and
127 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
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,47 @@ | ||
import Moya | ||
import Domain | ||
import AppNetwork | ||
|
||
enum SystemAPI { | ||
case fetchServerStatus | ||
} | ||
|
||
extension SystemAPI: JobisAPI { | ||
typealias ErrorType = UsersError | ||
|
||
var domain: JobisDomain { | ||
.presignedURL | ||
} | ||
|
||
var urlPath: String { | ||
switch self { | ||
case .fetchServerStatus: | ||
return "" | ||
} | ||
} | ||
|
||
var method: Method { | ||
switch self { | ||
case .fetchServerStatus: | ||
return .get | ||
} | ||
} | ||
|
||
var task: Task { | ||
switch self { | ||
default: | ||
return .requestPlain | ||
} | ||
} | ||
|
||
var jwtTokenType: JwtTokenType { | ||
switch self { | ||
default: | ||
return .none | ||
} | ||
} | ||
|
||
var errorMap: [Int: ErrorType]? { | ||
return nil | ||
} | ||
} |
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
47 changes: 47 additions & 0 deletions
47
Projects/Data/Sources/DataSource/API/WinterInternAPI.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,47 @@ | ||
import Moya | ||
import Domain | ||
import AppNetwork | ||
|
||
enum WinterInternAPI { | ||
case fetchWinterInternSeason | ||
} | ||
|
||
extension WinterInternAPI: JobisAPI { | ||
typealias ErrorType = JobisError | ||
|
||
var domain: JobisDomain { | ||
.winterIntern | ||
} | ||
|
||
var urlPath: String { | ||
switch self { | ||
case .fetchWinterInternSeason: | ||
return "" | ||
} | ||
} | ||
|
||
var method: Moya.Method { | ||
switch self { | ||
case .fetchWinterInternSeason: | ||
return .get | ||
} | ||
} | ||
|
||
var task: Moya.Task { | ||
switch self { | ||
default: | ||
return .requestPlain | ||
} | ||
} | ||
|
||
var jwtTokenType: JwtTokenType { | ||
.accessToken | ||
} | ||
|
||
var errorMap: [Int: ErrorType]? { | ||
switch self { | ||
case .fetchWinterInternSeason: | ||
return [:] | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Projects/Data/Sources/DataSource/Remote/RemoteSystemDataSource.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,13 @@ | ||
import RxSwift | ||
import Domain | ||
|
||
protocol RemoteSystemDataSource { | ||
func fetchServerStatus() -> Completable | ||
} | ||
|
||
final class RemoteSystemDataSourceImpl: RemoteBaseDataSource<SystemAPI>, RemoteSystemDataSource { | ||
func fetchServerStatus() -> Completable { | ||
request(.fetchServerStatus) | ||
.asCompletable() | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
Projects/Data/Sources/DataSource/Remote/RemoteWinterInternDataSource.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,22 @@ | ||
import Foundation | ||
import RxSwift | ||
import Domain | ||
|
||
protocol RemoteWinterInternDataSource { | ||
func fetchWinterInternSeason() -> Single<Bool> | ||
} | ||
|
||
final class RemoteWinterInternDataSourceImpl: RemoteBaseDataSource<WinterInternAPI>, RemoteWinterInternDataSource { | ||
func fetchWinterInternSeason() -> Single<Bool> { | ||
return request(.fetchWinterInternSeason) | ||
.map { response -> Bool in | ||
if let data = try? JSONDecoder().decode(Bool.self, from: response.data) { | ||
return data | ||
} else { | ||
print("failed to load winterInterSeason") | ||
return false | ||
} | ||
} | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
Projects/Data/Sources/Repositories/SystemRepositoryImpl.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,15 @@ | ||
import RxSwift | ||
import Domain | ||
|
||
struct SystemRepositoryImpl: SystemRepository { | ||
private let remoteSystemDataSource: any RemoteSystemDataSource | ||
|
||
init(remoteSystemDataSource: any RemoteSystemDataSource) { | ||
self.remoteSystemDataSource = remoteSystemDataSource | ||
} | ||
|
||
func fetchServerStatus() -> Completable { | ||
remoteSystemDataSource.fetchServerStatus() | ||
} | ||
|
||
} |
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/Data/Sources/Repositories/WinterInternRepositoryImpl.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 @@ | ||
import RxSwift | ||
import Domain | ||
|
||
struct WinterInternRepositoryImpl: WinterInternRepository { | ||
private let remoteWinterInternDataSource: any RemoteWinterInternDataSource | ||
|
||
init(remoteWinterInternDataSource: any RemoteWinterInternDataSource) { | ||
self.remoteWinterInternDataSource = remoteWinterInternDataSource | ||
} | ||
|
||
func fetchWinterInternSeason() -> Single<Bool> { | ||
remoteWinterInternDataSource.fetchWinterInternSeason() | ||
} | ||
} |
Oops, something went wrong.