-
Notifications
You must be signed in to change notification settings - Fork 1
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
홈 화면에서 카테고리 별로 책 필터링하여 보여주기 #73
Changes from all commits
28d2831
a510a7f
917fc8d
47ec366
fd0e502
92cebea
6b69911
72a5abb
a558b54
a16da91
274d8d5
e7b6bc2
a2b5feb
c67cb46
2beda37
35de2bc
f27b853
4dff15d
a578088
473ad10
8d50ce8
ac3d2b3
f5a3c48
46e5a47
063c2e5
35cca0f
88e9190
6889e79
291a294
b2a5e09
78ddd97
ac53ec8
b65fe03
e4c461b
3c28fb9
18c85d3
243aa86
5b19080
1fc9577
d78fe38
fa688a9
26c6168
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import MHDomain | ||
|
||
public struct DefaultMemorialHouseRepository: MemorialHouseRepository { | ||
public init() { } | ||
|
||
public func fetchMemorialHouse() async -> MemorialHouse { | ||
// TODO: CoreData로부터 꺼내오기 | ||
Check warning on line 7 in MemorialHouse/MHData/MHData/Repository/DefaultUserHouseRepository.swift GitHub Actions / SwiftLint
|
||
return MemorialHouse(name: "", categories: [], bookCovers: []) | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
public enum BookColor { | ||
public enum BookColor: Sendable { | ||
case beige | ||
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. P3: 엔티티에 Sendable을 붙여주는 이유가 무엇인가요?? 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. |
||
case blue | ||
case green | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
import MHFoundation | ||
|
||
public struct BookCover { | ||
public let bookIdentifer = UUID() | ||
public struct BookCover: Equatable, Sendable { | ||
public let identifier: UUID | ||
public let title: String | ||
public let imageURL: String | ||
public let bookColor: BookColor | ||
public let category: String | ||
public let isLike: Bool | ||
public let imageURL: String? | ||
public let color: BookColor | ||
public let category: String? | ||
public let favorite: Bool | ||
|
||
public init( | ||
identifier: UUID = .init(), | ||
title: String, | ||
imageURL: String, | ||
bookColor: BookColor, | ||
category: String, | ||
isLike: Bool = false | ||
imageURL: String?, | ||
color: BookColor, | ||
category: String?, | ||
favorite: Bool = false | ||
) { | ||
self.identifier = identifier | ||
self.title = title | ||
self.imageURL = imageURL | ||
self.bookColor = bookColor | ||
self.color = color | ||
self.category = category | ||
self.isLike = isLike | ||
self.favorite = favorite | ||
} | ||
|
||
public static func == (lhs: BookCover, rhs: BookCover) -> Bool { | ||
lhs.identifier == rhs.identifier | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
public struct MemorialHouse: Sendable { | ||
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. UserHouse에서 MemorialHouse로 네이밍 변경했습니다 |
||
public let name: String | ||
public let categories: [String] | ||
public let bookCovers: [BookCover] | ||
|
||
public init( | ||
name: String, | ||
categories: [String], | ||
bookCovers: [BookCover] | ||
) { | ||
self.name = name | ||
self.categories = categories | ||
self.bookCovers = bookCovers | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
public protocol MemorialHouseRepository: Sendable { | ||
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. P3: 여기도 Sendable이 붙었군요.. 혹시 왜 붙었는지 알 수 있을까요?? |
||
func fetchMemorialHouse() async -> MemorialHouse | ||
} |
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.
기존에 UserDefaults에서 이름을 꺼내고 HomeViewModel에 넘겨주던 로직을 제거하고,
HomeViewModel이 CoreData에 저장되어 있는
MemorialHouse
엔티티 모델로부터 이름을 받아오는 것으로 변경했습니다