-
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 #91 from WhereAreYouPJ/feat/Feeds
- Loading branch information
Showing
8 changed files
with
107 additions
and
5 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
12 changes: 12 additions & 0 deletions
12
Where_Are_You/Data/Models/Requests/Member/TokenReissueBody.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,12 @@ | ||
// | ||
// TokenReissueBody.swift | ||
// Where_Are_You | ||
// | ||
// Created by 오정석 on 13/1/2025. | ||
// | ||
|
||
import Foundation | ||
|
||
struct TokenReissueBody: ParameterConvertible { | ||
let refreshToken: String | ||
} |
14 changes: 14 additions & 0 deletions
14
Where_Are_You/Data/Models/Responses/Member/TokenReissueResponse.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 @@ | ||
// | ||
// TokenReissueResponse.swift | ||
// Where_Are_You | ||
// | ||
// Created by 오정석 on 13/1/2025. | ||
// | ||
|
||
import Foundation | ||
|
||
struct TokenReissueResponse: Codable { | ||
let accessToken: String | ||
let refreshToken: String | ||
let memberSeq: Int | ||
} |
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
31 changes: 31 additions & 0 deletions
31
Where_Are_You/Domain/UseCases/Member/TokenReissueUseCase.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,31 @@ | ||
// | ||
// TokenReissueUseCase.swift | ||
// Where_Are_You | ||
// | ||
// Created by 오정석 on 13/1/2025. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol TokenReissueUseCase { | ||
func execute(request: TokenReissueBody, completion: @escaping (Result<TokenReissueResponse, Error>) -> Void) | ||
} | ||
|
||
class TokenReissueUseCaseImpl: TokenReissueUseCase { | ||
private let memberRepository: MemberRepositoryProtocol | ||
|
||
init(memberRepository: MemberRepositoryProtocol) { | ||
self.memberRepository = memberRepository | ||
} | ||
|
||
func execute(request: TokenReissueBody, completion: @escaping (Result<TokenReissueResponse, any Error>) -> Void) { | ||
memberRepository.postTokenReissue(request: request) { result in | ||
switch result { | ||
case .success(let response): | ||
completion(.success(response.data)) | ||
case .failure(let error): | ||
completion(.failure(error)) | ||
} | ||
} | ||
} | ||
} |
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