-
Notifications
You must be signed in to change notification settings - Fork 0
[#454] Infra 레이어에서 Domain 레이어 의존성을 제거한다 #469
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
10 commits
Select commit
Hold shift + click to select a range
b828273
chore: TodoService의 Domain 의존성 제거
opficdev 9029a8a
chore: WebPage 데이터 흐름에서 Domain 에러 의존성 제거
opficdev 3535fa7
refactor: 도메인쪽 에러로 매핑하는 메서드이므로 toDomain()으로 수정
opficdev 3e30150
refactor: 불필요 import문 제거
opficdev 52c4645
refactor: 공통 설정 모델을 Core로 이동
opficdev f59b4d9
refactor: 인증 에러를 Data와 Domain 경계에서 매핑하도록 정리
opficdev 61391e4
refactor: PushNotificationService의 Domain 의존성 제거
opficdev a53e67f
refactor: TodoCategoryService 응답을 Data 모델로 분리하여 Domain 의존성 제거
opficdev 8c0f76d
chore: Infra 레이어에서 Domain 레이어 의존성 완전 제거
opficdev 8462995
refactor: TodoCategory 선호도 중복 확인 로직 개선
opficdev 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
2 changes: 1 addition & 1 deletion
2
...ources/Entity/PushNotificationQuery.swift → ...gCore/Sources/PushNotificationQuery.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,6 +1,6 @@ | ||
| // | ||
| // PushNotificationQuery.swift | ||
| // DevLogDomain | ||
| // DevLogCore | ||
| // | ||
| // Created by opfic on 2/18/26. | ||
| // | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
...ogDomain/Sources/Entity/SystemTheme.swift → ...tion/DevLogCore/Sources/SystemTheme.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,6 +1,6 @@ | ||
| // | ||
| // SystemTheme.swift | ||
| // DevLogDomain | ||
| // DevLogCore | ||
| // | ||
| // Created by opfic on 5/6/25. | ||
| // | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
.../Sources/Entity/TodayDisplayOptions.swift → ...LogCore/Sources/TodayDisplayOptions.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,6 +1,6 @@ | ||
| // | ||
| // TodayDisplayOptions.swift | ||
| // DevLogDomain | ||
| // DevLogCore | ||
| // | ||
| // Created by opfic on 3/6/26. | ||
| // | ||
|
|
||
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
42 changes: 42 additions & 0 deletions
42
Application/DevLogData/Sources/DTO/TodoCategoryPreferenceResponse.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,42 @@ | ||
| // | ||
| // TodoCategoryPreferenceResponse.swift | ||
| // DevLogData | ||
| // | ||
| // Created by opfic on 5/16/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public struct TodoCategoryPreferenceResponse: Equatable { | ||
| public enum Category: Equatable { | ||
| case system(String) | ||
| case user(UserCategory) | ||
| } | ||
|
|
||
| public struct UserCategory: Equatable { | ||
| public let id: String | ||
| public let name: String | ||
| public let colorHex: String | ||
|
|
||
| public init( | ||
| id: String, | ||
| name: String, | ||
| colorHex: String | ||
| ) { | ||
| self.id = id | ||
| self.name = name | ||
| self.colorHex = colorHex | ||
| } | ||
| } | ||
|
|
||
| public let category: Category | ||
| public let isVisible: Bool | ||
|
|
||
| public init( | ||
| category: Category, | ||
| isVisible: Bool | ||
| ) { | ||
| self.category = category | ||
| self.isVisible = isVisible | ||
| } | ||
| } |
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,21 @@ | ||
| // | ||
| // ErrorMapping.swift | ||
| // DevLogData | ||
| // | ||
| // Created by opfic on 5/16/26. | ||
| // | ||
|
|
||
| import DevLogDomain | ||
|
|
||
| extension Error { | ||
| func toDomain() -> Error { | ||
| switch self as? DataLayerError { | ||
| case .notAuthenticated: | ||
| return AuthError.notAuthenticated | ||
| case .linkCredentialAlreadyInUse: | ||
| return AuthError.linkCredentialAlreadyInUse | ||
| case .none: | ||
| return self | ||
| } | ||
| } | ||
| } |
101 changes: 101 additions & 0 deletions
101
Application/DevLogData/Sources/Mapper/TodoCategoryMapping.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,101 @@ | ||
| // | ||
| // TodoCategoryMapping.swift | ||
| // DevLogData | ||
| // | ||
| // Created by opfic on 5/16/26. | ||
| // | ||
|
|
||
| import DevLogDomain | ||
|
|
||
| extension TodoCategoryPreferenceResponse { | ||
| static func fromDomain(_ preference: TodoCategoryPreference) -> Self { | ||
| switch preference.category { | ||
| case .system(let systemTodoCategory): | ||
| return TodoCategoryPreferenceResponse( | ||
| category: .system(systemTodoCategory.rawValue), | ||
| isVisible: preference.isVisible | ||
| ) | ||
| case .user(let userTodoCategory): | ||
| return TodoCategoryPreferenceResponse( | ||
| category: .user( | ||
| UserCategory( | ||
| id: userTodoCategory.id, | ||
| name: userTodoCategory.name, | ||
| colorHex: userTodoCategory.colorHex | ||
| ) | ||
| ), | ||
| isVisible: preference.isVisible | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| func toDomain() -> TodoCategoryPreference? { | ||
| switch category { | ||
| case .system(let rawValue): | ||
| guard let systemTodoCategory = SystemTodoCategory(rawValue: rawValue) else { | ||
| return nil | ||
| } | ||
|
|
||
| return TodoCategoryPreference( | ||
| category: .system(systemTodoCategory), | ||
| isVisible: isVisible | ||
| ) | ||
| case .user(let userCategory): | ||
| return TodoCategoryPreference( | ||
| category: .user( | ||
| UserTodoCategory( | ||
| id: userCategory.id, | ||
| name: userCategory.name, | ||
| colorHex: userCategory.colorHex | ||
| ) | ||
| ), | ||
| isVisible: isVisible | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| extension Array where Element == TodoCategoryPreferenceResponse { | ||
| func toDomain() -> [TodoCategoryPreference] { | ||
| let preferences = compactMap { $0.toDomain() } | ||
| guard !preferences.isEmpty else { | ||
| return defaultTodoCategoryPreferences() | ||
| } | ||
|
|
||
| return mergedTodoCategoryPreferences(preferences) | ||
| } | ||
| } | ||
|
|
||
| private func defaultTodoCategoryPreferences() -> [TodoCategoryPreference] { | ||
| SystemTodoCategory.allCases.map { | ||
| TodoCategoryPreference(category: .system($0), isVisible: true) | ||
| } | ||
| } | ||
|
|
||
| private func mergedTodoCategoryPreferences( | ||
| _ preferences: [TodoCategoryPreference] | ||
| ) -> [TodoCategoryPreference] { | ||
| var mergedPreferences = preferences | ||
| let existingSystemTodoCategories = Set<SystemTodoCategory>( | ||
| preferences.compactMap { preference in | ||
| guard case .system(let systemTodoCategory) = preference.category else { | ||
| return nil | ||
| } | ||
|
|
||
| return systemTodoCategory | ||
| } | ||
| ) | ||
|
|
||
| for systemTodoCategory in SystemTodoCategory.allCases { | ||
| if existingSystemTodoCategories.contains(systemTodoCategory) { continue } | ||
|
|
||
| mergedPreferences.append( | ||
| TodoCategoryPreference( | ||
| category: .system(systemTodoCategory), | ||
| isVisible: true | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| return mergedPreferences | ||
| } | ||
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
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 |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| // | ||
|
|
||
| import Foundation | ||
| import DevLogCore | ||
| import DevLogDomain | ||
|
|
||
| public protocol WidgetSnapshotUpdater { | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -94,6 +94,6 @@ private extension AuthDataRepositoryImpl { | |
| } | ||
| } | ||
|
|
||
| return error | ||
| return error.toDomain() | ||
| } | ||
| } | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.