-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat #165 postAuthCodeUseCase 생성, API 요청
- Loading branch information
1 parent
1461220
commit da9b22c
Showing
6 changed files
with
98 additions
and
18 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
34 changes: 34 additions & 0 deletions
34
Project_Timer/Domain/UseCase/AuthV2/PostAuthCodeUseCase.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,34 @@ | ||
// | ||
// PostAuthCodeUseCase.swift | ||
// Project_Timer | ||
// | ||
// Created by Kang Minsang on 2024/09/29. | ||
// Copyright © 2024 FDEE. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import Combine | ||
|
||
final class PostAuthCodeUseCase { | ||
enum PostType { | ||
case signup(email: String) | ||
} | ||
|
||
private let repository: AuthV2Repository // TODO: 프로토콜로 수정 | ||
|
||
init(repository: AuthV2Repository) { | ||
self.repository = repository | ||
} | ||
|
||
func execute(type: PostType) -> AnyPublisher<PostAuthCodeInfo, NetworkError> { | ||
switch type { | ||
case .signup(let email): | ||
return self.repository.postAuthcode( | ||
request: PostAuthCodeRequest( | ||
targetType: "EMAIL", | ||
targetValue: email, | ||
authType: "SIGN_UP") | ||
) | ||
} | ||
} | ||
} |
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