generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ :: [#134] DI / AppComponent+Lecture 추가
- Loading branch information
Showing
27 changed files
with
293 additions
and
125 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
52 changes: 52 additions & 0 deletions
52
App/Sources/Application/DI/Lecture/AppComponent+Lecture.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,52 @@ | ||
import NeedleFoundation | ||
import Service | ||
|
||
public extension AppComponent { | ||
var remoteLectureDataSource: any RemoteLectureDataSource { | ||
shared { | ||
RemoteLectureDataSourceImpl(keychain: keychain) | ||
} | ||
} | ||
|
||
var lectureRepository: any LectureRepository { | ||
shared { | ||
LectureRepositoryImpl(remoteLectureDataSource: remoteLectureDataSource) | ||
} | ||
} | ||
|
||
var lectureOpenUseCase: any LectureOpenUseCase { | ||
shared { | ||
LectureOpenUseCaseImpl(lectureRepository: lectureRepository) | ||
} | ||
} | ||
|
||
var lectureListInquiryUseCase: any LectureListInquirtyUseCase { | ||
shared { | ||
LectureListInquirtyUseCaseImpl(lectureRepository: lectureRepository) | ||
} | ||
} | ||
|
||
var lectureDetailInquiryUseCase: any LectureDetailInquiryUseCase { | ||
shared { | ||
LectureDetailInquiryUseCaseImpl(lectureRepository: lectureRepository) | ||
} | ||
} | ||
|
||
var lectureApplyUseCase: any LectureApplyUseCase { | ||
shared { | ||
LectureApplyUseCaseImpl(lectureRepository: lectureRepository) | ||
} | ||
} | ||
|
||
var waitingLectureApproveUseCase: any WaitingLectureApproveUseCase { | ||
shared { | ||
WaitingLectureApproveUseCaseImpl(lectureRepository: lectureRepository) | ||
} | ||
} | ||
|
||
var waitingLectureRejectUseCase: any WaitingLectureRejectUseCase { | ||
shared { | ||
WaitingLectureRejectUseCaseImpl(lectureRepository: lectureRepository) | ||
} | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
...Sources/Feature/ActivityDetailSettingFeature/Sources/ActivityDetailSettingComponent.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
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
27 changes: 27 additions & 0 deletions
27
Service/Sources/Data/DataSource/Lecture/RemoteLectureDataSourceImpl.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,27 @@ | ||
import Foundation | ||
|
||
public final class RemoteLectureDataSourceImpl: BaseRemoteDataSource<LectureAPI>, RemoteLectureDataSource { | ||
public func lectureOpen(req: LectureOpenRequestDTO) async throws { | ||
try await request(.lectureOpen(req)) | ||
} | ||
|
||
public func lectureListInquiry() async throws { | ||
try await request(.lectureListInquiry) | ||
} | ||
|
||
public func lectureDetailInquiry(userID: String) async throws { | ||
try await request(.lectureDetailInquiry(userID: userID)) | ||
} | ||
|
||
public func lectureApply(userID: String) async throws { | ||
try await request(.lectureApply(userID: userID)) | ||
} | ||
|
||
public func waitingLectureApprove(userID: String) async throws { | ||
try await request(.waitingLectureApprove(userID: userID)) | ||
} | ||
|
||
public func waitingLectureReject(userID: String) async throws { | ||
try await request(.waitingLectureReject(userID: userID)) | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
Service/Sources/Data/DataSource/User/RemoteUserDataSourceImpl.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
4 changes: 2 additions & 2 deletions
4
Service/Sources/Data/Repository/Lecture/LectureRepositoryImpl.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
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
6 changes: 3 additions & 3 deletions
6
Service/Sources/Data/UseCase/Lecture/LectureDetailInquiryUseCaseImpl.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,13 +1,13 @@ | ||
import Foundation | ||
|
||
struct LectureDetailInquiryUseCaseImpl: LectureDetailInquiryUseCase { | ||
public struct LectureDetailInquiryUseCaseImpl: LectureDetailInquiryUseCase { | ||
private let lectureRepository: any LectureRepository | ||
|
||
init(lectureRepository: any LectureRepository) { | ||
public init(lectureRepository: any LectureRepository) { | ||
self.lectureRepository = lectureRepository | ||
} | ||
|
||
func callAsFunction(userID: String) async throws { | ||
public func callAsFunction(userID: String) async throws { | ||
try await lectureRepository.lectureDetailInquiry(userID: userID) | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
Service/Sources/Data/UseCase/Lecture/LectureListInquirtyUseCaseImpl.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,13 +1,13 @@ | ||
import Foundation | ||
|
||
struct LectureListInquirtyUseCaseImpl: LectureListInquirtyUseCase { | ||
public struct LectureListInquirtyUseCaseImpl: LectureListInquirtyUseCase { | ||
private let lectureRepository: any LectureRepository | ||
|
||
init(lectureRepository: any LectureRepository) { | ||
public init(lectureRepository: any LectureRepository) { | ||
self.lectureRepository = lectureRepository | ||
} | ||
|
||
func callAsFunction() async throws { | ||
public func callAsFunction() async throws { | ||
try await lectureRepository.lectureListInquiry() | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
Service/Sources/Data/UseCase/Lecture/LectureOpenUseCaseImpl.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
6 changes: 3 additions & 3 deletions
6
Service/Sources/Data/UseCase/Lecture/WaitingLectureApproveUseCaseImpl.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,13 +1,13 @@ | ||
import Foundation | ||
|
||
struct WaitingLectureApproveUseCaseImpl: WaitingLectureUseCase { | ||
public struct WaitingLectureApproveUseCaseImpl: WaitingLectureApproveUseCase { | ||
private let lectureRepository: any LectureRepository | ||
|
||
init(lectureRepository: any LectureRepository) { | ||
public init(lectureRepository: any LectureRepository) { | ||
self.lectureRepository = lectureRepository | ||
} | ||
|
||
func callAsFunction(userID: String) async throws { | ||
public func callAsFunction(userID: String) async throws { | ||
try await lectureRepository.waitingLectureApprove(userID: userID) | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
Service/Sources/Data/UseCase/Lecture/WaitingLectureRejectUseCaseImpl.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,13 +1,13 @@ | ||
import Foundation | ||
|
||
struct WaitingLectureRejectUseCaseImpl: WaitingLectureRejectUseCase { | ||
public struct WaitingLectureRejectUseCaseImpl: WaitingLectureRejectUseCase { | ||
private let lectureRepository: any LectureRepository | ||
|
||
init(lectureRepository: any LectureRepository) { | ||
public init(lectureRepository: any LectureRepository) { | ||
self.lectureRepository = lectureRepository | ||
} | ||
|
||
func callAsFunction(userID: String) async throws { | ||
public func callAsFunction(userID: String) async throws { | ||
try await lectureRepository.waitingLectureReject(userID: userID) | ||
} | ||
} |
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
31 changes: 7 additions & 24 deletions
31
Service/Sources/Domain/LectureDomain/DataSource/RemoteLectureDataSource.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,27 +1,10 @@ | ||
import Foundation | ||
|
||
final class RemoteLectureDataSource: BaseRemoteDataSource<LectureAPI> { | ||
func lectureOpen(req: LectureOpenRequestDTO) async throws { | ||
try await request(.lectureOpen(req)) | ||
} | ||
|
||
func lectureListInquiry() async throws { | ||
try await request(.lectureListInquiry) | ||
} | ||
|
||
func lectureDetailInquiry(userID: String) async throws { | ||
try await request(.lectureDetailInquiry(userID: userID)) | ||
} | ||
|
||
func lectureApply(userID: String) async throws { | ||
try await request(.lectureApply(userID: userID)) | ||
} | ||
|
||
func waitingLectureApprove(userID: String) async throws { | ||
try await request(.waitingLectureApprove(userID: userID)) | ||
} | ||
|
||
func waitingLectureReject(userID: String) async throws { | ||
try await request(.waitingLectureReject(userID: userID)) | ||
} | ||
public protocol RemoteLectureDataSource: BaseRemoteDataSource<LectureAPI> { | ||
func lectureOpen(req: LectureOpenRequestDTO) async throws | ||
func lectureListInquiry() async throws | ||
func lectureDetailInquiry(userID: String) async throws | ||
func lectureApply(userID: String) async throws | ||
func waitingLectureApprove(userID: String) async throws | ||
func waitingLectureReject(userID: String) async throws | ||
} |
2 changes: 1 addition & 1 deletion
2
Service/Sources/Domain/LectureDomain/UseCase/WaitingLectureUseCase.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,5 +1,5 @@ | ||
import Foundation | ||
|
||
public protocol WaitingLectureUseCase { | ||
public protocol WaitingLectureApproveUseCase { | ||
func callAsFunction(userID: String) async throws | ||
} |
Oops, something went wrong.