Skip to content

Commit

Permalink
⏪ :: [#75] DI / AppComponent + Auth 되돌리기
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuunseo committed Nov 28, 2023
1 parent ab3dc2c commit 0fb5c4c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions App/Sources/Application/DI/Auth/AppComponent+Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import NeedleFoundation
import Service

public extension AppComponent {
var localAuthDataSource: LocalAuthDataSource {
var localAuthDataSource: any LocalAuthDataSource {
shared {
LocalAuthDataSource(keychain: keychain)
LocalAuthDataSourceImpl(keychain: keychain)
}
}

var remoteAuthDataSource: RemoteAuthDataSource {
var remoteAuthDataSource: any RemoteAuthDataSource {
shared {
RemoteAuthDataSource(keychian: keychain)
RemoteAuthDataSourceImpl(keychian: keychain)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct LocalAuthDataSourceImpl: LocalAuthDataSource {
public struct LocalAuthDataSourceImpl: LocalAuthDataSource {
private let keychain: any Keychain

public init(keychain: any Keychain) {
Expand Down
22 changes: 11 additions & 11 deletions Service/Sources/Data/DataSource/Auth/RemoteDataSourceImpl.swift
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
import Foundation

final class RemoteAuthDataSourceImpl: BaseRemoteDataSource<AuthAPI>, RemoteAuthDataSource {
func login(req: LoginRequestDTO) async throws {
public final class RemoteAuthDataSourceImpl: BaseRemoteDataSource<AuthAPI>, RemoteAuthDataSource {
public func login(req: LoginRequestDTO) async throws {
try await request(.login(req))
}

func reissueToken() async throws {
public func reissueToken() async throws {
try await request(.reissueToken)
}

func logout() async throws {
public func logout() async throws {
try await request(.logout)
}

func withdraw() async throws {
public func withdraw() async throws {
try await request(.withdraw)
}

func studentSignup(req: StudentSignupRequestDTO) async throws {
public func studentSignup(req: StudentSignupRequestDTO) async throws {
try await request(.studentSignup(req))
}

func teacherSignup(req: TeacherSignupRequestDTO) async throws {
public func teacherSignup(req: TeacherSignupRequestDTO) async throws {
try await request(.teacherSignup(req))
}

func bbozzakSignup(req: BbozzakSignupRequestDTO) async throws {
public func bbozzakSignup(req: BbozzakSignupRequestDTO) async throws {
try await request(.bbozzakSignup(req))
}

func professorSignup(req: ProfessorSignupRequestDTO) async throws {
public func professorSignup(req: ProfessorSignupRequestDTO) async throws {
try await request(.professorSignup(req))
}

func governmentSignup(req: GovernmentSignupRequestDTO) async throws {
public func governmentSignup(req: GovernmentSignupRequestDTO) async throws {
try await request(.governmentSignup(req))
}

func companyInstructorSignup(req: CompanyInstructorSignupRequestDTO) async throws {
public func companyInstructorSignup(req: CompanyInstructorSignupRequestDTO) async throws {
try await request(.companyInstructorSignup(req))
}
}
Expand Down
4 changes: 2 additions & 2 deletions Service/Sources/Data/Repository/Auth/AuthRepositoryImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public struct AuthRepositoryImpl: AuthRepository {

public func logout() async throws {
try await remoteAuthDataSource.logout()
localAuthDataSource.logout()
try await localAuthDataSource.logout()
}

public func withdraw() async throws {
try await remoteAuthDataSource.withdraw()
localAuthDataSource.withdraw()
try await localAuthDataSource.withdraw()
}

public func studentSignup(req: StudentSignupRequestDTO) async throws {
Expand Down

0 comments on commit 0fb5c4c

Please sign in to comment.