-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] 링크, 폴더 삭제 로직 구현 #51
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
Changes from all commits
d5df54e
da87898
6378b43
47f91a6
e581509
47f8b7e
23f1ff6
d97464a
3bc33e3
e5b3a9e
351c65d
03672c1
1a6e8bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,10 +14,22 @@ struct WebLinkDTO: Codable { | |
| var thumbnailUrl: String? | ||
| var faviconUrl: String? | ||
| var isPinned: Bool | ||
| var createdBy: Date | ||
| var createdAt: Date | ||
| var lastAccessedAt: Date? | ||
| var folderID: String? | ||
|
|
||
| enum CodingKeys: String, CodingKey { | ||
| case id = "id" | ||
| case url = "url" | ||
| case title = "title" | ||
| case thumbnailUrl = "thumbnailUrl" | ||
| case faviconUrl = "faviconUrl" | ||
| case isPinned = "isPinned" | ||
| case createdAt = "createdAt" | ||
| case lastAccessedAt = "lastAccessedAt" | ||
| case folderID = "folderID" | ||
| } | ||
|
Comment on lines
+21
to
+31
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Firestore 문서에 저장되는 Field를 관리하기 위해 FirestoreFieldKey를 구현했습니다. Firestore 데이터를 DTO로 매핑하기 위해서는 Firestore의 Field와 DTO의 프로퍼티가 매핑이 되어야하고, 이를 위해 CodingKey를 사용했습니다. |
||
|
|
||
| func toEntity() -> WebLink { | ||
| WebLink( | ||
| id: self.id, | ||
|
|
@@ -26,7 +38,7 @@ struct WebLinkDTO: Codable { | |
| thumbnailUrl: self.thumbnailUrl, | ||
| faviconUrl: self.faviconUrl, | ||
| isPinned: self.isPinned, | ||
| createdBy: self.createdBy, | ||
| createdAt: self.createdAt, | ||
| lastAccessedAt: self.lastAccessedAt, | ||
| folderID: self.folderID | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // | ||
| // FirestoreFieldKey.swift | ||
| // Mark-In | ||
| // | ||
| // Created by 이정동 on 6/4/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| enum FirestoreFieldKey { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 공통화하기에 애매한 부분 같아요! |
||
| enum Link { | ||
| static let id = "id" | ||
| static let url = "url" | ||
| static let title = "title" | ||
| static let thumbnailUrl = "thumbnailUrl" | ||
| static let faviconUrl = "faviconUrl" | ||
| static let isPinned = "isPinned" | ||
| static let createdAt = "createdAt" | ||
| static let lastAccessedAt = "lastAccessedAt" | ||
| static let folderID = "folderID" | ||
| } | ||
|
|
||
| enum Folder { | ||
| static let id = "id" | ||
| static let name = "name" | ||
| static let createdAt = "createdAt" | ||
| } | ||
| } | ||
|
Comment on lines
+10
to
+28
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Firestore 문서에 저장되는 Field를 관리하기 위함입니다. |
||
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.
불필요한 코드면 제거되는게 좋아보여요