generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #147 from Team-Ampersand/144-withdrawal-impl
🔀 :: [#144] 회원탈퇴 기능 추가
- Loading branch information
Showing
24 changed files
with
191 additions
and
8 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
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
Projects/Domain/UserDomain/Interface/DataSource/RemoteUserDataSource.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,3 @@ | ||
public protocol RemoteUserDataSource { | ||
func withdrawal() async throws | ||
} |
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
3 changes: 3 additions & 0 deletions
3
Projects/Domain/UserDomain/Interface/UseCase/WithdrawalUseCase.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,3 @@ | ||
public protocol WithdrawalUseCase { | ||
func callAsFunction() async throws | ||
} |
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
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
Projects/Domain/UserDomain/Sources/DataSource/Remote/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import UserDomainInterface | ||
import NetworkingInterface | ||
|
||
final class RemoteUserDataSourceImpl: RemoteUserDataSource { | ||
private let networking: any Networking | ||
|
||
init(networking: any Networking) { | ||
self.networking = networking | ||
} | ||
|
||
func withdrawal() async throws { | ||
try await networking.request(UserEndpoint.withdrawal) | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Projects/Domain/UserDomain/Sources/DataSource/Remote/UserEndpoint.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,40 @@ | ||
import Emdpoint | ||
import NetworkingInterface | ||
|
||
public enum UserEndpoint { | ||
case withdrawal | ||
} | ||
|
||
extension UserEndpoint: DotoriEndpoint { | ||
public var domain: DotoriRestAPIDomain { | ||
.user | ||
} | ||
|
||
public var route: Route { | ||
switch self { | ||
case .withdrawal: | ||
return .delete("/withdrawal") | ||
} | ||
} | ||
|
||
public var task: HTTPTask { | ||
switch self { | ||
default: | ||
return .requestPlain | ||
} | ||
} | ||
|
||
public var jwtTokenType: JwtTokenType { | ||
switch self { | ||
default: | ||
return .accessToken | ||
} | ||
} | ||
|
||
public var errorMap: [Int: Error] { | ||
switch self { | ||
default: | ||
return [:] | ||
} | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
Projects/Domain/UserDomain/Sources/UseCase/WithdrawalUseCaseImpl.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 UserDomainInterface | ||
|
||
struct WithdrawalUseCaseImpl: WithdrawalUseCase { | ||
private let userRepository: any UserRepository | ||
|
||
init(userRepository: any UserRepository) { | ||
self.userRepository = userRepository | ||
} | ||
|
||
func callAsFunction() async throws { | ||
try await userRepository.withdrawal() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Projects/Domain/UserDomain/Testing/DataSource/RemoteUserDataSourceSpy.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,9 @@ | ||
import Foundation | ||
import UserDomainInterface | ||
|
||
final class RemoteUserDataSourceSpy: RemoteUserDataSource { | ||
var withdrawalCallCount = 0 | ||
func withdrawal() async throws { | ||
withdrawalCallCount += 1 | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
Projects/Domain/UserDomain/Testing/UseCase/WithdrawalUseCaseSpy.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,8 @@ | ||
import UserDomainInterface | ||
|
||
final class WithdrawalUseCaseSpy: WithdrawalUseCase { | ||
var withdrawalCallCount = 0 | ||
func callAsFunction() async throws { | ||
withdrawalCallCount += 1 | ||
} | ||
} |
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
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
Oops, something went wrong.