-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/#19 travel follow contents api #20
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 all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4ff4422
design: #19 - MediaInfoview ์์ ๋ณ๊ฒฝ
KimNahun f16239e
design: #19 - BudgetView ์์ ๋ฐ ๋ ์ด์์ ์กฐ์
KimNahun bc078c5
design: #19 - ์๋ฒ์ชฝ ์์ ๋ api์ ๋ง๊ฒ ๋์์ธ ์์
KimNahun 1e12001
feat: #19 - ์บ๋ฆฐ๋ ๋ ์ง๊ฐ ๋ ์ ์ ์ ๊ฒฝ๊ณ ๋ฌธ๊ตฌ ์ถ๊ฐ
KimNahun c35d4ac
design: #19 - ์ฑ ๋ด์ ๊ณตํต์ ์ผ๋ก ์ฐ์ด๋ modalviewcontroller ์ ์
KimNahun 3e85e6b
feat: #19 - ์ฑ ๋ด์ ์ ์ฒด์ ์ผ๋ก ์ฐ์ด๋ ํค์ฒด์ธ ์คํ ๋ฆฌ์ง ๊ตฌํ
KimNahun 67798d3
refactor: #19 - ์ฑ ๋ด์ ๊ตฌ์กฐ, ๋ชจ๋๊ฐ ์ญํ ๋ถ๋ฆฌ
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| // | ||
| // KeychainStorage.swift | ||
| // Core | ||
| // | ||
| // Created by NDGL on 2026-02-06. | ||
| // Copyright ยฉ 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
| import Security | ||
|
|
||
| public protocol KeychainStorageProtocol { | ||
| func save(_ value: String, forKey key: String) -> Bool | ||
| func load(forKey key: String) -> String? | ||
| func delete(forKey key: String) -> Bool | ||
| func clear() -> Bool | ||
| } | ||
|
|
||
| public final class KeychainStorage: KeychainStorageProtocol { | ||
|
|
||
| private let service: String | ||
|
|
||
| public init(service: String = Bundle.main.bundleIdentifier ?? "com.ndgl.app") { | ||
| self.service = service | ||
| } | ||
|
|
||
| @discardableResult | ||
| public func save(_ value: String, forKey key: String) -> Bool { | ||
| guard let data = value.data(using: .utf8) else { return false } | ||
|
|
||
| // ๊ธฐ์กด ํญ๋ชฉ ์ญ์ | ||
| delete(forKey: key) | ||
|
|
||
| let query: [String: Any] = [ | ||
| kSecClass as String: kSecClassGenericPassword, | ||
| kSecAttrService as String: service, | ||
| kSecAttrAccount as String: key, | ||
| kSecValueData as String: data, | ||
| kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly | ||
| ] | ||
|
|
||
| let status = SecItemAdd(query as CFDictionary, nil) | ||
| return status == errSecSuccess | ||
| } | ||
|
|
||
| public func load(forKey key: String) -> String? { | ||
| let query: [String: Any] = [ | ||
| kSecClass as String: kSecClassGenericPassword, | ||
| kSecAttrService as String: service, | ||
| kSecAttrAccount as String: key, | ||
| kSecReturnData as String: true, | ||
| kSecMatchLimit as String: kSecMatchLimitOne | ||
| ] | ||
|
|
||
| var result: AnyObject? | ||
| let status = SecItemCopyMatching(query as CFDictionary, &result) | ||
|
|
||
| guard status == errSecSuccess, | ||
| let data = result as? Data, | ||
| let value = String(data: data, encoding: .utf8) else { | ||
| return nil | ||
| } | ||
|
|
||
| return value | ||
| } | ||
|
|
||
| @discardableResult | ||
| public func delete(forKey key: String) -> Bool { | ||
| let query: [String: Any] = [ | ||
| kSecClass as String: kSecClassGenericPassword, | ||
| kSecAttrService as String: service, | ||
| kSecAttrAccount as String: key | ||
| ] | ||
|
|
||
| let status = SecItemDelete(query as CFDictionary) | ||
| return status == errSecSuccess || status == errSecItemNotFound | ||
| } | ||
|
|
||
| @discardableResult | ||
| public func clear() -> Bool { | ||
| let query: [String: Any] = [ | ||
| kSecClass as String: kSecClassGenericPassword, | ||
| kSecAttrService as String: service | ||
| ] | ||
|
|
||
| let status = SecItemDelete(query as CFDictionary) | ||
| return status == errSecSuccess || status == errSecItemNotFound | ||
| } | ||
| } |
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,23 @@ | ||
| // | ||
| // TokenProviderAdapter.swift | ||
| // Data | ||
| // | ||
| // Created by NDGL on 2026-02-06. | ||
| // Copyright ยฉ 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
|
|
||
| public final class TokenProviderAdapter: TokenProviding, @unchecked Sendable { | ||
|
|
||
| private let tokenRepository: TokenRepositoryProtocol | ||
|
|
||
| public init(tokenRepository: TokenRepositoryProtocol) { | ||
| self.tokenRepository = tokenRepository | ||
| } | ||
|
|
||
| public func accessToken() -> String? { | ||
| tokenRepository.get(.accessToken) | ||
| } | ||
| } |
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 @@ | ||
| // | ||
| // FollowServiceFactory.swift | ||
| // Data | ||
| // | ||
| // Created by NDGL on 2026-02-06. | ||
| // Copyright ยฉ 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
| import Networks | ||
|
|
||
| public func makeFollowService() -> FollowServiceProtocol { | ||
| FollowService() | ||
| } |
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,28 @@ | ||
| // | ||
| // TokenRepositoryFactory.swift | ||
| // Data | ||
| // | ||
| // Created by NDGL on 2026-02-06. | ||
| // Copyright ยฉ 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Core | ||
| import Domain | ||
| import Foundation | ||
|
|
||
| public enum TokenRepositoryFactory { | ||
|
|
||
| public static func make() -> TokenRepositoryProtocol { | ||
| let keychainStorage = KeychainStorage() | ||
| return TokenRepository(keychainStorage: keychainStorage) | ||
| } | ||
|
|
||
| public static func makeTokenProvider() -> TokenProviding { | ||
| let tokenRepository = make() | ||
| return TokenProviderAdapter(tokenRepository: tokenRepository) | ||
| } | ||
|
|
||
| public static func makeTokenProvider(with repository: TokenRepositoryProtocol) -> TokenProviding { | ||
| TokenProviderAdapter(tokenRepository: repository) | ||
| } | ||
| } |
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 @@ | ||
| // | ||
| // TravelServiceFactory.swift | ||
| // Data | ||
| // | ||
| // Created by NDGL on 2026-02-06. | ||
| // Copyright ยฉ 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Domain | ||
| import Foundation | ||
| import Moya | ||
| import Networks | ||
|
|
||
| public func makeTravelService(tokenProvider: TokenProviding) -> TravelServiceProtocol { | ||
| let provider: MoyaProvider<TravelAPI> = NetworkProviderFactory.makeAuthenticatedProvider( | ||
| tokenProvider: tokenProvider | ||
| ) | ||
| return TravelService(provider: provider) | ||
| } |
40 changes: 0 additions & 40 deletions
40
Projects/Data/Sources/Repository/Auth/AuthRepository.swift
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
Projects/Data/Sources/Repository/Auth/TokenRepository.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,38 @@ | ||
| // | ||
| // TokenRepository.swift | ||
| // Data | ||
| // | ||
| // Created by NDGL on 2026-02-06. | ||
| // Copyright ยฉ 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Core | ||
| import Domain | ||
| import Foundation | ||
|
|
||
| public final class TokenRepository: TokenRepositoryProtocol { | ||
|
|
||
| // MARK: - Properties | ||
|
|
||
| private let keychainStorage: KeychainStorageProtocol | ||
|
|
||
| // MARK: - Initialization | ||
|
|
||
| public init(keychainStorage: KeychainStorageProtocol) { | ||
| self.keychainStorage = keychainStorage | ||
| } | ||
|
|
||
| // MARK: - TokenRepositoryProtocol | ||
|
|
||
| public func save(_ value: String, for type: TokenType) { | ||
| keychainStorage.save(value, forKey: type.rawValue) | ||
| } | ||
|
|
||
| public func get(_ type: TokenType) -> String? { | ||
| keychainStorage.load(forKey: type.rawValue) | ||
| } | ||
|
|
||
| public func delete(_ type: TokenType) { | ||
| keychainStorage.delete(forKey: type.rawValue) | ||
| } | ||
| } | ||
41 changes: 0 additions & 41 deletions
41
Projects/Data/Sources/Repository/Follow/FollowRepository.swift
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
...terface/Auth/AuthRepositoryProtocol.swift โ .../Interface/Auth/AuthServiceProtocol.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 |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| // | ||
| // AuthRepositoryProtocol.swift | ||
| // AuthServiceProtocol.swift | ||
| // Domain | ||
| // | ||
| // Created by kimnahun on 1/21/26. | ||
| // Created by NDGL on 2026-02-06. | ||
| // Copyright ยฉ 2026 NDGL-iOS. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public protocol AuthRepositoryProtocol: Sendable { | ||
| public protocol AuthServiceProtocol: Sendable { | ||
| func signup(info: SignupInfo) async -> Result<SignupResult, SignupError> | ||
| } |
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.
save์delete๋ฉ์๋์์ ๋ฐํ๊ฐ์ด ๋ฌด์๋๊ณ ์์ต๋๋ค.keychainStorage.save()์keychainStorage.delete()์Bool๋ฐํ๊ฐ์ด ๋ฌด์๋๊ณ ์์ต๋๋ค. ์ ์ฅ/์ญ์ ์คํจ ์ ํธ์ถ์์๊ฒ ์๋ ค์ผ ํ๋ ๊ฒฝ์ฐ๋ฅผ ๊ณ ๋ คํด ๋ณด์ธ์.๐ก ๋ฐํ๊ฐ ์ ํ ๊ณ ๋ ค
ํ์ฌ ๊ตฌํ๋ ๋ฌธ์ ์์ด ๋์ํ์ง๋ง, ์คํจ ์ฒ๋ฆฌ๊ฐ ํ์ํ ๊ฒฝ์ฐ๋ฅผ ์ํด ๋ค์๊ณผ ๊ฐ์ด ๋ณ๊ฒฝํ ์ ์์ต๋๋ค:
๋๋ ํ์ฌ ํ๋กํ ์ฝ ์ค๊ณ๊ฐ void ๋ฐํ์ ์๋ํ ๊ฒ์ด๋ผ๋ฉด ๋ฌด์ํด๋ ๋ฉ๋๋ค.
๐ Committable suggestion
๐ค Prompt for AI Agents