From 8b289f4bb761f4d04e4c6f88ef43b4ddd3cbfa47 Mon Sep 17 00:00:00 2001 From: JWoong-01 Date: Fri, 6 Feb 2026 17:22:49 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=9D=91=EB=8B=B5=20=ED=95=84?= =?UTF-8?q?=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 --- .../java/com/dokdok/topic/api/ConfirmTopicApi.java | 2 +- .../topic/dto/response/ConfirmedTopicsResponse.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/dokdok/topic/api/ConfirmTopicApi.java b/src/main/java/com/dokdok/topic/api/ConfirmTopicApi.java index 18aa03c..6bc9393 100644 --- a/src/main/java/com/dokdok/topic/api/ConfirmTopicApi.java +++ b/src/main/java/com/dokdok/topic/api/ConfirmTopicApi.java @@ -47,7 +47,7 @@ public interface ConfirmTopicApi { content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = ConfirmedTopicsResponse.class), examples = @ExampleObject(value = """ - {"code":"SUCCESS","message":"확정된 주제 조회를 완료했습니다.","data":{"page":{"items":[{"topicId":10,"title":"데미안에서 '자기 자신'이란?","description":"주제에 대한 간단한 설명입니다.","topicType":"DISCUSSION","confirmOrder":1,"createdByInfo":{"userId":1,"nickname":"독서왕"}}],"pageSize":10,"hasNext":false,"nextCursor":null,"totalCount":1},"actions":{"canViewPreOpinions":true,"canWritePreOpinions":false}}} + {"code":"SUCCESS","message":"확정된 주제 조회를 완료했습니다.","data":{"items":[{"topicId":10,"title":"데미안에서 '자기 자신'이란?","description":"주제에 대한 간단한 설명입니다.","topicType":"DISCUSSION","topicTypeLabel":"토론형","likeCount":5,"confirmOrder":1,"createdByInfo":{"userId":1,"nickname":"독서왕"}}],"pageSize":10,"hasNext":false,"nextCursor":null,"totalCount":1,"actions":{"canViewPreOpinions":true,"canWritePreOpinions":false}}} """)) ), @io.swagger.v3.oas.annotations.responses.ApiResponse( diff --git a/src/main/java/com/dokdok/topic/dto/response/ConfirmedTopicsResponse.java b/src/main/java/com/dokdok/topic/dto/response/ConfirmedTopicsResponse.java index 19454de..4410b83 100644 --- a/src/main/java/com/dokdok/topic/dto/response/ConfirmedTopicsResponse.java +++ b/src/main/java/com/dokdok/topic/dto/response/ConfirmedTopicsResponse.java @@ -3,12 +3,15 @@ import com.dokdok.global.response.CursorResponse; import com.dokdok.topic.entity.Topic; import com.dokdok.topic.entity.TopicType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonUnwrapped; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; +@JsonPropertyOrder({"items", "pageSize", "hasNext", "nextCursor", "totalCount", "actions"}) @Schema(description = "확정된 주제 목록 응답") public record ConfirmedTopicsResponse( - @Schema(description = "확정된 주제 목록 페이지 정보") + @JsonUnwrapped CursorResponse page, @Schema(description = "사전 의견 관련 권한 정보") Actions actions @@ -35,6 +38,10 @@ public record ConfirmedTopicDto( String description, @Schema(description = "주제 타입", example = "DISCUSSION") TopicType topicType, + @Schema(description = "주제 타입 라벨", example = "토론형") + String topicTypeLabel, + @Schema(description = "좋아요 수", example = "5") + Integer likeCount, @Schema(description = "확정 순서", example = "1") Integer confirmOrder, @Schema(description = "주제 제안자 정보") @@ -46,6 +53,8 @@ public static ConfirmedTopicDto from(Topic topic) { .title(topic.getTitle()) .description(topic.getDescription()) .topicType(topic.getTopicType()) + .topicTypeLabel(topic.getTopicType().getDisplayName()) + .likeCount(topic.getLikeCount()) .confirmOrder(topic.getConfirmOrder()) .createdByInfo( CreatedByInfo.of(