From c0ca399f0ba63c0eda16b87243d160b29707c05b Mon Sep 17 00:00:00 2001 From: Seoyoung-Kyung Date: Sun, 8 Feb 2026 10:33:31 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=82=AC=EC=A0=84=EC=9D=98?= =?UTF-8?q?=EA=B2=AC=20=EC=A1=B0=ED=9A=8C=20API=20topicTypeLabel=20?= =?UTF-8?q?=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=9D=BC?= =?UTF-8?q?=EB=B6=80=20=ED=95=84=EB=93=9C=EB=AA=85=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dokdok/topic/api/PreOpinionApi.java | 2 +- .../topic/dto/response/PreOpinionResponse.java | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/dokdok/topic/api/PreOpinionApi.java b/src/main/java/com/dokdok/topic/api/PreOpinionApi.java index c685074..d610937 100644 --- a/src/main/java/com/dokdok/topic/api/PreOpinionApi.java +++ b/src/main/java/com/dokdok/topic/api/PreOpinionApi.java @@ -44,7 +44,7 @@ public interface PreOpinionApi { content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(implementation = PreOpinionResponse.class), examples = @ExampleObject(value = """ - {"code":"SUCCESS","message":"약속의 사전 의견 목록 조회를 성공했습니다.","data":{"topics":[{"topicId":1,"topicName":"책의 주요 메시지","topicDescription":"이 책에서 전달하고자 하는 핵심 메시지는 무엇인가요?","topicType":"토론","confirmOrder":1}],"members":[{"memberInfo":{"memberId":1,"nickname":"독서왕","profileImage":"https://example.com/profile.jpg"},"bookReview":{"rating":4.5,"bookKeywords":["성장","관계"],"impressionKeywords":["여운이 남는","즐거운"]},"topicOpinions":[{"topicId":1,"content":"저는 이 책의 핵심 메시지가 자기 성찰이라고 생각합니다."}]}]}} + {"code":"SUCCESS","message":"약속의 사전 의견 목록 조회를 성공했습니다.","data":{"topics":[{"topicId":1,"title":"책의 주요 메시지","description":"이 책에서 전달하고자 하는 핵심 메시지는 무엇인가요?","topicType":"DISCUSSION","topicTypeLabel":"DISCUSSION","confirmOrder":1}],"members":[{"memberInfo":{"memberId":1,"nickname":"독서왕","profileImage":"https://example.com/profile.jpg"},"bookReview":{"rating":4.5,"bookKeywords":["성장","관계"],"impressionKeywords":["여운이 남는","즐거운"]},"topicOpinions":[{"topicId":1,"content":"저는 이 책의 핵심 메시지가 자기 성찰이라고 생각합니다."}]}]}} """)) ), @io.swagger.v3.oas.annotations.responses.ApiResponse( diff --git a/src/main/java/com/dokdok/topic/dto/response/PreOpinionResponse.java b/src/main/java/com/dokdok/topic/dto/response/PreOpinionResponse.java index 5792eb2..2e096b0 100644 --- a/src/main/java/com/dokdok/topic/dto/response/PreOpinionResponse.java +++ b/src/main/java/com/dokdok/topic/dto/response/PreOpinionResponse.java @@ -2,6 +2,7 @@ import com.dokdok.topic.entity.Topic; import com.dokdok.topic.entity.TopicAnswer; +import com.dokdok.topic.entity.TopicType; import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; @@ -22,13 +23,17 @@ public record TopicInfo( Long topicId, @Schema(description = "주제명", example = "책의 주요 메시지") - String topicName, + String title, @Schema(description = "주제 설명", example = "이 책에서 전달하고자 하는 핵심 메시지는 무엇인가요?") - String topicDescription, + String description, - @Schema(description = "주제 타입", example = "토론") - String topicType, + @Schema(description = "주제 타입", example = "DISCUSSION", + allowableValues = {"FREE", "DISCUSSION", "EMOTION", "EXPERIENCE", "CHARACTER_ANALYSIS", "COMPARISON", "STRUCTURE", "IN_DEPTH", "CREATIVE", "CUSTOM"}) + TopicType topicType, + + @Schema(description = "주제 타입 라벨", example = "토론형") + String topicTypeLabel, @Schema(description = "주제 순서", example = "1") Integer confirmOrder @@ -38,6 +43,7 @@ public static TopicInfo from(Topic topic) { topic.getId(), topic.getTitle(), topic.getDescription(), + topic.getTopicType(), topic.getTopicType().getDisplayName(), topic.getConfirmOrder() );