-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/#3 네트워크 모듈화 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d7f66c0
del: #3 - Networks 모듈 기존 empty 파일 삭제
KimNahun 52a0cb5
feat: #3- 네트워크 Base 레이어 구현
KimNahun a428a40
feat: #3 - Moya async/await 확장 구현
KimNahun cdebdd0
feat: #3 - Networks 모듈 설정 및 BASE_URL 환경변수 구현
KimNahun dbb4e1d
feat: #3 - Signup API 에러 타입 정의
KimNahun 0fccc13
feat: #3- SigninDTO, AuthService, api 생성
KimNahun 1c19b5b
chore: #3- 오타수정. signin -> signup
KimNahun 1a0975c
chore: #3 - internal -> public 변경 및 post 테스트코드 작성 ( 실제 api 호출됨 )
KimNahun cd3952e
chore: #3 - BUILD LIBRARY FOR DISTRIBUTION 설정 off
KimNahun 149bb1a
chore: #3 - Sendable 채택
KimNahun 47c9724
del: #3- 개행 문자 제거
KimNahun 1737620
refactor: #3: 로직 변경 - data, domain, feature 모듈간 의존성 유지 - 클린아키텍처에 맞게 변…
KimNahun 963d842
del: #3 - userAlreadyExists case 제거
KimNahun a6c41a3
feat: #3 - 네트워크 Logger 추가 구현
KimNahun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,19 @@ | ||
| // | ||
| // AuthRepositoryFactory.swift | ||
| // Data | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
| import Networks | ||
|
|
||
| public func makeAuthService() -> AuthServiceProtocol { | ||
| AuthService() | ||
| } | ||
|
|
||
| public func makeAuthRepository(authService: AuthServiceProtocol) -> AuthRepositoryProtocol { | ||
| AuthRepository(authService: authService) | ||
| } |
40 changes: 40 additions & 0 deletions
40
Projects/Data/Sources/Repository/Auth/AuthRepository.swift
This file contains hidden or 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 @@ | ||
| // | ||
| // AuthRepository.swift | ||
| // Data | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
| import Networks | ||
|
|
||
| public final class AuthRepository: AuthRepositoryProtocol, @unchecked Sendable { | ||
| private let authService: AuthServiceProtocol | ||
|
|
||
| public init(authService: AuthServiceProtocol) { | ||
| self.authService = authService | ||
| } | ||
|
|
||
| public func signup(info: SignupInfo) async -> Result<SignupResult, SignupError> { | ||
| let request = SignupRequest(fcmToken: info.fcmToken) | ||
| let result = await authService.signup(request: request) | ||
|
|
||
| switch result { | ||
| case .success(let response): | ||
| let signupResult = SignupResult( | ||
| uuid: response.uuid, | ||
| accessToken: response.accessToken, | ||
| nickname: response.nickname | ||
| ) | ||
| return .success(signupResult) | ||
|
|
||
| case .failure(let error): | ||
| return .failure(error) | ||
|
|
||
| case .networkFailure(let networkError): | ||
| return .failure(.networkError(message: networkError.localizedDescription)) | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| // | ||
| // AuthTransform.swift | ||
| // Data | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
| import Networks | ||
|
|
||
| extension SignupResult { | ||
| init(from response: SignupResponse) { | ||
| self.init( | ||
| uuid: response.uuid, | ||
| accessToken: response.accessToken, | ||
| nickname: response.nickname | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| extension SignupRequest { | ||
| init(from info: SignupInfo) { | ||
| self.init(fcmToken: info.fcmToken) | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
Projects/Domain/Sources/Interface/Auth/AuthRepositoryProtocol.swift
This file contains hidden or 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 @@ | ||
| // | ||
| // AuthRepositoryProtocol.swift | ||
| // Domain | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public protocol AuthRepositoryProtocol: Sendable { | ||
| func signup(info: SignupInfo) async -> Result<SignupResult, SignupError> | ||
| } |
This file contains hidden or 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,26 @@ | ||
| // | ||
| // SignupError.swift | ||
| // Domain | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| // MARK: - SignupField | ||
|
|
||
| public enum SignupField: Sendable, Equatable { | ||
| case fcmToken | ||
| case email | ||
| case unknown(String) | ||
| } | ||
|
|
||
| // MARK: - SignupError | ||
|
|
||
| public enum SignupError: Error, Sendable { | ||
| case validationFailed(field: SignupField, message: String) | ||
| case serverError(message: String?) | ||
| case networkError(message: String) | ||
| case unknown(code: String, message: String) | ||
| } |
This file contains hidden or 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,17 @@ | ||
| // | ||
| // SignupInfo.swift | ||
| // Domain | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public struct SignupInfo: Sendable { | ||
| public let fcmToken: String | ||
|
|
||
| public init(fcmToken: String) { | ||
| self.fcmToken = fcmToken | ||
| } | ||
| } |
This file contains hidden or 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,21 @@ | ||
| // | ||
| // SignupResult.swift | ||
| // Domain | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public struct SignupResult: Sendable { | ||
| public let uuid: String | ||
| public let accessToken: String | ||
| public let nickname: String | ||
|
|
||
| public init(uuid: String, accessToken: String, nickname: String) { | ||
| self.uuid = uuid | ||
| self.accessToken = accessToken | ||
| self.nickname = nickname | ||
| } | ||
| } |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,15 @@ | ||
| // | ||
| // BaseResponse.swift | ||
| // Networks | ||
| // | ||
| // Created by kimnahun on 1/19/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct BaseResponse<T: Decodable & Sendable>: Decodable, Sendable { | ||
| let code: String | ||
| let message: String | ||
| let data: T? | ||
| } |
11 changes: 11 additions & 0 deletions
11
Projects/Modules/Networks/Sources/Base/EmptyResponse.swift
This file contains hidden or 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,11 @@ | ||
| // | ||
| // EmptyResponse.swift | ||
| // Networks | ||
| // | ||
| // Created by kimnahun on 1/19/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct EmptyResponse: Decodable, Sendable {} |
20 changes: 20 additions & 0 deletions
20
Projects/Modules/Networks/Sources/Base/ErrorResponse.swift
This file contains hidden or 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,20 @@ | ||
| // | ||
| // ErrorResponse.swift | ||
| // Networks | ||
| // | ||
| // Created by kimnahun on 1/19/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public struct ErrorResponse: Decodable, Sendable { | ||
| public let code: String? | ||
| public let message: String? | ||
| public let errors: [ErrorDetail]? | ||
|
|
||
| public struct ErrorDetail: Decodable, Sendable { | ||
| public let field: String? | ||
| public let message: String? | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,26 @@ | ||
| // | ||
| // NetworkError.swift | ||
| // Networks | ||
| // | ||
| // Created by kimnahun on 1/19/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public enum NetworkError: Error, Sendable { | ||
| case connectionFailed | ||
| case decodingFailed | ||
| case unknown(String) | ||
|
|
||
| public var message: String { | ||
| switch self { | ||
| case .connectionFailed: | ||
| return "네트워크 연결을 확인해주세요" | ||
| case .decodingFailed: | ||
| return "데이터 처리 중 오류가 발생했습니다" | ||
| case .unknown(let description): | ||
| return "알 수 없는 오류: \(description)" | ||
| } | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
Projects/Modules/Networks/Sources/Base/NetworkResult.swift
This file contains hidden or 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,16 @@ | ||
| // | ||
| // NetworkResult.swift | ||
| // Networks | ||
| // | ||
| // Created by kimnahun on 1/19/26. | ||
| // Copyright © 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| @frozen | ||
| public enum NetworkResult<T: Sendable, E: Error & Sendable>: Sendable { | ||
| case success(T) | ||
| case failure(E) | ||
| case networkFailure(NetworkError) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: YAPP-Github/27th-App-Team-1-iOS
Length of output: 194
🏁 Script executed:
Repository: YAPP-Github/27th-App-Team-1-iOS
Length of output: 1364
xcconfig 파일 누락으로 인한 빌드 실패 위험 - 즉시 수정 필요
39-42줄에서 참조하는
xcconfigs/Debug.xcconfig와xcconfigs/Release.xcconfig파일이 존재하지 않습니다. 33줄의$(BASE_URL)빌드 변수는 해석되지 않아 테스트 빌드가 실패하거나, NetworkConfiguration.swift의 fatalError(18줄)로 인해 런타임에 충돌합니다. 누락된 xcconfig 파일들을 추가하고 BASE_URL을 정의해야 합니다.🤖 Prompt for AI Agents