Skip to content

Commit 6c795c9

Browse files
committed
refacto: 엔티티 모델에 Hashable을 일괄 적용하여 프레젠테이션 모델에서 구현을 최소화
1 parent 648e4be commit 6c795c9

13 files changed

Lines changed: 7 additions & 37 deletions

DevLog/Domain/Entity/PushNotification.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct PushNotification {
10+
struct PushNotification: Hashable {
1111
let id: String
1212
let title: String
1313
let body: String

DevLog/Domain/Entity/SystemTodoCategory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
enum SystemTodoCategory: String, CaseIterable {
10+
enum SystemTodoCategory: String, CaseIterable, Hashable {
1111
case issue // 이슈
1212
case feature // 신규 기능
1313
case improvement // 개선/리팩터링

DevLog/Domain/Entity/Todo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct Todo: Equatable {
10+
struct Todo: Hashable {
1111
let id: String
1212
var isPinned: Bool // 해당 할 일이 상단에 고정되어 있는지 여부
1313
var isCompleted: Bool // 해당 할 일의 완료 여부

DevLog/Domain/Entity/TodoCategory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
enum TodoCategory: Equatable {
10+
enum TodoCategory: Hashable {
1111
case system(SystemTodoCategory)
1212
case user(UserTodoCategory)
1313

DevLog/Domain/Entity/TodoReference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct TodoReference {
10+
struct TodoReference: Hashable {
1111
let id: String
1212
let title: String
1313
let category: TodoCategory

DevLog/Domain/Entity/UserTodoCategory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct UserTodoCategory: Equatable {
10+
struct UserTodoCategory: Hashable {
1111
var id: String
1212
var name: String
1313
var colorHex: String

DevLog/Domain/Entity/WebPage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct WebPage: Equatable {
10+
struct WebPage: Hashable {
1111
let title: String?
1212
let url: URL
1313
let displayURL: URL

DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,4 @@ struct ProfileSelectedDayActivity: Identifiable, Hashable {
2020
}
2121
return showsCreated ? "생성" : "완료"
2222
}
23-
24-
func hash(into hasher: inout Hasher) {
25-
hasher.combine(todo.id)
26-
hasher.combine(showsCreated)
27-
hasher.combine(showsCompleted)
28-
}
2923
}

DevLog/Presentation/Structure/PushNotificationItem.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,4 @@ struct PushNotificationItem: Identifiable, Hashable {
2525
self.todoId = notification.todoId
2626
self.todoCategory = notification.todoCategory
2727
}
28-
29-
func hash(into hasher: inout Hasher) {
30-
hasher.combine(id)
31-
}
3228
}

DevLog/Presentation/Structure/RecentTodoItem.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,4 @@ struct RecentTodoItem: Identifiable, Hashable {
2525
self.tags = todo.tags
2626
self.category = todo.category
2727
}
28-
29-
func hash(into hasher: inout Hasher) {
30-
hasher.combine(id)
31-
}
3228
}

0 commit comments

Comments
 (0)