Skip to content

Commit

Permalink
✅ Chore: PostListResModel, LikeData Equatable 처리 (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwangJi-dev committed Nov 2, 2022
1 parent 9459d21 commit 26c04ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

// MARK: - Like
struct Like: Codable {
struct Like: Codable, Equatable {
let isLiked: Bool
let likeCount: Int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import Foundation

/// 커뮤니티 전체, 자유, 질문, 정보, 1:1 질문 전체 Post List 조회 Response Data Model
struct PostListResModel: Codable {
struct PostListResModel: Codable, Equatable {
static func == (lhs: PostListResModel, rhs: PostListResModel) -> Bool {
return (lhs.postID == rhs.postID && lhs.type == rhs.type && lhs.title == rhs.title && lhs.content == rhs.content && lhs.createdAt == rhs.createdAt && lhs.majorName == rhs.majorName && lhs.writer == rhs.writer && lhs.isAuthorized == rhs.isAuthorized && lhs.commentCount == rhs.commentCount && lhs.like == rhs.like)
}

let postID: Int
let type: String?
let title, content, createdAt: String
Expand All @@ -25,7 +29,7 @@ struct PostListResModel: Codable {
}


struct CommunityWriter: Codable {
struct CommunityWriter: Codable, Equatable {
let writerID: Int
let nickname: String

Expand Down

0 comments on commit 26c04ee

Please sign in to comment.