Skip to content

Commit

Permalink
[chore] #157 BaseContentItem 속성값 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeKim98 committed Nov 28, 2024
1 parent 389daa5 commit 43b0e25
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Projects/App/Sources/MainTab/MainTabPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public extension MainTabFeature {
),
title: content.title,
data: content.data,
memo: content.memo,
memo: content.memo ?? "",
createdAt: content.createdAt,
favorites: nil,
alertYn: .no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ public struct ContentBaseResponse: Decodable {
public let data: String
public let domain: String
public let title: String
public let memo: String?
public let thumbNail: String
public let createdAt: String
public let isRead: Bool?
public let isFavorite: Bool?
}

extension ContentBaseResponse {
Expand All @@ -29,9 +31,11 @@ extension ContentBaseResponse {
data: "https://www.youtube.com/watch?v=wtSwdGJzQCQ",
domain: "youtube",
title: "신서유기",
memo: nil,
thumbNail: "https://i.ytimg.com/vi/NnOC4_kH0ok/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLDN6u6mTjbaVmRZ4biJS_aDq4uvAQ",
createdAt: "2024.08.08",
isRead: false
isRead: false,
isFavorite: true
)
}
}
Expand Down
8 changes: 7 additions & 1 deletion Projects/Domain/Sources/Base/BaseContentItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,37 @@ public struct BaseContentItem: Identifiable, Equatable, PokitLinkCardItem, Sorta
public let categoryName: String
public let categoryId: Int
public let title: String
public let memo: String?
public var thumbNail: String
public let data: String
public let domain: String
public let createdAt: String
public let isRead: Bool?
public let isFavorite: Bool?

public init(
id: Int,
categoryName: String,
categoryId: Int,
title: String,
memo: String?,
thumbNail: String,
data: String,
domain: String,
createdAt: String,
isRead: Bool?
isRead: Bool?,
isFavorite: Bool?
) {
self.id = id
self.categoryName = categoryName
self.categoryId = categoryId
self.title = title
self.memo = memo
self.thumbNail = thumbNail
self.data = data
self.domain = domain
self.createdAt = createdAt
self.isRead = isRead
self.isFavorite = isFavorite
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ extension CategorySharing {
public let data: String
public let domain: String
public let title: String
public let memo: String
public let memo: String?
public let thumbNail: String
public let createdAt: String
public let categoryName: String
public let isRead: Bool? = false
public let isFavorite: Bool? = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public extension ContentBaseResponse {
categoryName: self.category.categoryName,
categoryId: self.category.categoryId,
title: self.title,
memo: self.memo,
thumbNail: self.thumbNail,
data: self.data,
domain: self.domain,
createdAt: self.createdAt,
isRead: self.isRead
isRead: self.isRead,
isFavorite: self.isFavorite
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ private extension CategorySharingFeature {
categoryName: content.categoryName,
categoryId: state.category.categoryId,
title: content.title,
memo: content.memo,
thumbNail: content.thumbNail,
data: content.data,
domain: content.domain,
createdAt: content.createdAt,
isRead: content.isRead
isRead: content.isRead,
isFavorite: content.isFavorite
)))
}
state.isLoading = false
Expand All @@ -176,11 +178,13 @@ private extension CategorySharingFeature {
categoryName: content.categoryName,
categoryId: state.category.categoryId,
title: content.title,
memo: content.memo,
thumbNail: content.thumbNail,
data: content.data,
domain: content.domain,
createdAt: content.createdAt,
isRead: content.isRead
isRead: content.isRead,
isFavorite: content.isFavorite
)))
}
state.isLoading = false
Expand Down
2 changes: 2 additions & 0 deletions Projects/Util/Sources/Protocols/PokitLinkCardItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import Foundation

public protocol PokitLinkCardItem {
var title: String { get }
var memo: String? { get }
var thumbNail: String { get }
var createdAt: String { get }
var categoryName: String { get }
var isRead: Bool? { get }
var data: String { get }
var domain: String { get }
var isFavorite: Bool? { get }
}

0 comments on commit 43b0e25

Please sign in to comment.