-
Notifications
You must be signed in to change notification settings - Fork 0
[#148] 데이터와 인프라 간 DTO 및 Mapper을 확인한다 #155
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
e9ecba5
chore: 파일 위치 이동
opficdev b75b303
refactor: TodoCursorResponse -> TodoCursorDTO
opficdev 9afa210
chore: DTO를 인프라 -> 데이터 레이어로 이동
opficdev b7bc425
refactor: DTO에서 Firestore 의존성을 제거 후 변환 형태를 서비스 레이어에서 담당하도록 수정
opficdev b557883
refactor: id 타입에 옵셔널 제거
opficdev 6704947
refactor: key를 enum으로 정의
opficdev b8ca602
refactor: Dictionaryable을 제거하고 엔코더로 대체
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,13 @@ | ||
| // | ||
| // TodoCursorDTO.swift | ||
| // DevLog | ||
| // | ||
| // Created by opfic on 2/21/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct TodoCursorDTO { | ||
| let createdAt: Date | ||
| let documentID: 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,37 @@ | ||
| // | ||
| // TodoDTO.swift | ||
| // DevLog | ||
| // | ||
| // Created by 최윤진 on 12/14/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct TodoRequest: Encodable { | ||
| let id: String | ||
| let isPinned: Bool | ||
| let isCompleted: Bool | ||
| let isChecked: Bool | ||
| let title: String | ||
| let content: String | ||
| let createdAt: Date | ||
| let updatedAt: Date | ||
| let dueDate: Date? | ||
| let tags: [String] | ||
| let kind: TodoKind | ||
|
|
||
| } | ||
|
|
||
| struct TodoResponse { | ||
| let id: String | ||
| let isPinned: Bool | ||
| let isCompleted: Bool | ||
| let isChecked: Bool | ||
| let title: String | ||
| let content: String | ||
| let createdAt: Date | ||
| let updatedAt: Date | ||
| let dueDate: Date? | ||
| let tags: [String] | ||
| let kind: 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
File renamed without changes.
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
File renamed without changes.
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 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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
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.
TodoRequest를 인코딩할 때id프로퍼티가 인코딩에서 제외되도록CodingKeys를 명시적으로 정의하는 것을 고려해 보세요.id는 Firestore 문서의 ID로 사용되며, 데이터 페이로드에는 포함되지 않는 것이 일반적입니다.CodingKeys를 사용하면TodoService에서 수동으로id키를 제거하는 로직을 없앨 수 있어, DTO의 역할이 더 명확해지고 코드가 간결해집니다.이 변경을 적용하려면
TodoService의upsertTodo메서드에서data.removeValue(forKey: TodoFieldKey.id.rawValue)라인도 함께 제거해야 합니다.