From 7c61c15e474f6e19b1e197543206077c0630cdac Mon Sep 17 00:00:00 2001 From: mooninbeom Date: Thu, 22 May 2025 10:31:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[#38]=20=EB=8B=B5=EB=B3=80=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20Entity=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/QappleRepository/DTO/Answer/AnswerListOfMine.swift | 1 + Sources/QappleRepository/DTO/Answer/AnswerListOfQuestion.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/QappleRepository/DTO/Answer/AnswerListOfMine.swift b/Sources/QappleRepository/DTO/Answer/AnswerListOfMine.swift index 0759bf3..76ee182 100644 --- a/Sources/QappleRepository/DTO/Answer/AnswerListOfMine.swift +++ b/Sources/QappleRepository/DTO/Answer/AnswerListOfMine.swift @@ -24,6 +24,7 @@ public struct AnswerListOfMine: Decodable, Sendable { public let profileImage: String? public let content: String public let heartCount: Int + public let commentCount: Int public let writeAt: String public let isLiked: Bool } diff --git a/Sources/QappleRepository/DTO/Answer/AnswerListOfQuestion.swift b/Sources/QappleRepository/DTO/Answer/AnswerListOfQuestion.swift index 9641958..02112ac 100644 --- a/Sources/QappleRepository/DTO/Answer/AnswerListOfQuestion.swift +++ b/Sources/QappleRepository/DTO/Answer/AnswerListOfQuestion.swift @@ -24,7 +24,7 @@ public struct AnswerListOfQuestion: Decodable, Sendable { public let content: String public let isMine: Bool public let isReported: Bool - public let isLiked: Bool? + public let isLiked: Bool public let writeAt: String public let commentCount: Int public let heartCount: Int From ebf3ae4370b1598f3a1dc208e4871a67c49d1b07 Mon Sep 17 00:00:00 2001 From: mooninbeom Date: Thu, 22 May 2025 12:18:31 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[#38]=20discardableResult=20=ED=82=A4?= =?UTF-8?q?=EC=9B=8C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/QappleRepository/UseCase/AdminQuestionAPI.swift | 2 ++ Sources/QappleRepository/UseCase/AnswerAPI.swift | 4 ++++ Sources/QappleRepository/UseCase/AnswerCommentAPI.swift | 3 +++ Sources/QappleRepository/UseCase/BoardAPI.swift | 3 +++ Sources/QappleRepository/UseCase/BoardCommentAPI.swift | 3 +++ Sources/QappleRepository/UseCase/ReportAPI.swift | 5 ++++- 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Sources/QappleRepository/UseCase/AdminQuestionAPI.swift b/Sources/QappleRepository/UseCase/AdminQuestionAPI.swift index 81f4473..a700da7 100644 --- a/Sources/QappleRepository/UseCase/AdminQuestionAPI.swift +++ b/Sources/QappleRepository/UseCase/AdminQuestionAPI.swift @@ -12,6 +12,7 @@ import Foundation */ public enum AdminQuestionAPI: Sendable { /// 질문을 생성하는 API 입니다. + @discardableResult public static func createQuestion( questionStatus: CreateQuestionRequest.QuestionStatus, content: String, @@ -29,6 +30,7 @@ public enum AdminQuestionAPI: Sendable { } /// 질문을 삭제하는 API 입니다. + @discardableResult public static func deleteQuestion( questionId: Int, server: Server, diff --git a/Sources/QappleRepository/UseCase/AnswerAPI.swift b/Sources/QappleRepository/UseCase/AnswerAPI.swift index 17812c6..71c85e0 100644 --- a/Sources/QappleRepository/UseCase/AnswerAPI.swift +++ b/Sources/QappleRepository/UseCase/AnswerAPI.swift @@ -25,6 +25,7 @@ public enum AnswerAPI: Sendable { } /// 답변 삭제 API 입니다. + @discardableResult public static func delete( answerId: Int, server: Server, @@ -51,6 +52,7 @@ public enum AnswerAPI: Sendable { } /// 답변 생성 API 입니다. + @discardableResult public static func create( content: String, questionId: Int, @@ -67,6 +69,8 @@ public enum AnswerAPI: Sendable { ) } + /// 답변에 좋아요 추가 or 취소를 하는 API 입니다. + @discardableResult public static func like( answerId: Int, server: Server, diff --git a/Sources/QappleRepository/UseCase/AnswerCommentAPI.swift b/Sources/QappleRepository/UseCase/AnswerCommentAPI.swift index ac2ca94..d6197c4 100644 --- a/Sources/QappleRepository/UseCase/AnswerCommentAPI.swift +++ b/Sources/QappleRepository/UseCase/AnswerCommentAPI.swift @@ -20,6 +20,7 @@ public enum AnswerCommentAPI: Sendable { } /// 특정 답변에 댓글을 생성합니다. + @discardableResult public static func createAnswerComment( answerId: Int, content: String, @@ -33,6 +34,7 @@ public enum AnswerCommentAPI: Sendable { } /// 답변에 있는 특정 댓글을 삭제합니다. + @discardableResult public static func deleteAnswerComment( answerCommentId: Int, server: Server, @@ -44,6 +46,7 @@ public enum AnswerCommentAPI: Sendable { } /// 답변에 있는 특정 댓글에 좋아요 추가 or 취소 합니다. + @discardableResult public static func likeAnswerComment( answerCommentId: Int, server: Server, diff --git a/Sources/QappleRepository/UseCase/BoardAPI.swift b/Sources/QappleRepository/UseCase/BoardAPI.swift index fbddd5b..085e5e4 100644 --- a/Sources/QappleRepository/UseCase/BoardAPI.swift +++ b/Sources/QappleRepository/UseCase/BoardAPI.swift @@ -25,6 +25,7 @@ public enum BoardAPI { } /// 게시글 생성 API입니다. + @discardableResult public static func create( content: String, boardType: CreateBoardRequest.BoardType, @@ -51,6 +52,7 @@ public enum BoardAPI { } /// 게시글 삭제 API입니다. + @discardableResult public static func delete( boardId: Int, server: Server, @@ -61,6 +63,7 @@ public enum BoardAPI { } /// 게시글 좋아요 및 취소 API입니다. + @discardableResult public static func like( boardId: Int, server: Server, diff --git a/Sources/QappleRepository/UseCase/BoardCommentAPI.swift b/Sources/QappleRepository/UseCase/BoardCommentAPI.swift index a689f02..3588015 100644 --- a/Sources/QappleRepository/UseCase/BoardCommentAPI.swift +++ b/Sources/QappleRepository/UseCase/BoardCommentAPI.swift @@ -30,6 +30,7 @@ public enum BoardCommentAPI { } /// 게시글 댓글 생성 API입니다. + @discardableResult public static func create( boardId: Int, content: String, @@ -51,6 +52,7 @@ public enum BoardCommentAPI { } /// 게시글 댓글 삭제 API입니다. + @discardableResult public static func delete( commentId: Int, server: Server, @@ -67,6 +69,7 @@ public enum BoardCommentAPI { } /// 게시글 댓글 좋아요 및 취소 API입니다. + @discardableResult public static func like( commentId: Int, server: Server, diff --git a/Sources/QappleRepository/UseCase/ReportAPI.swift b/Sources/QappleRepository/UseCase/ReportAPI.swift index 6d9d35e..38ad06e 100644 --- a/Sources/QappleRepository/UseCase/ReportAPI.swift +++ b/Sources/QappleRepository/UseCase/ReportAPI.swift @@ -11,6 +11,7 @@ import Foundation public enum ReportAPI: Sendable { /// 답변 신고 API입니다. + @discardableResult public static func reportAnswer( answerId: Int, reportType: ReportType, @@ -30,6 +31,7 @@ public enum ReportAPI: Sendable { } /// 게시글 신고 API입니다. + @discardableResult public static func reportBoard( boardId: Int, reportType: ReportType, @@ -48,7 +50,8 @@ public enum ReportAPI: Sendable { ) } - /// 게시글 신고 API입니다. + /// 게시글의 달린 특정 댓글 신고 API입니다. + @discardableResult public static func reportBoardComment( boardCommentId: Int, reportType: ReportType,