diff --git a/src/main/java/com/debatetimer/dto/member/TableResponse.java b/src/main/java/com/debatetimer/dto/member/TableResponse.java index 855213c..769d0ac 100644 --- a/src/main/java/com/debatetimer/dto/member/TableResponse.java +++ b/src/main/java/com/debatetimer/dto/member/TableResponse.java @@ -2,9 +2,14 @@ import com.debatetimer.domain.parliamentary.ParliamentaryTable; -public record TableResponse(String name, TableType type, int duration) { +public record TableResponse(long id, String name, TableType type, int duration) { public TableResponse(ParliamentaryTable parliamentaryTable) { - this(parliamentaryTable.getName(), TableType.PARLIAMENTARY, parliamentaryTable.getDuration()); + this( + parliamentaryTable.getId(), + parliamentaryTable.getName(), + TableType.PARLIAMENTARY, + parliamentaryTable.getDuration() + ); } } diff --git a/src/test/java/com/debatetimer/controller/member/MemberDocumentTest.java b/src/test/java/com/debatetimer/controller/member/MemberDocumentTest.java index f534011..a9edd6d 100644 --- a/src/test/java/com/debatetimer/controller/member/MemberDocumentTest.java +++ b/src/test/java/com/debatetimer/controller/member/MemberDocumentTest.java @@ -96,6 +96,7 @@ class GetTables { private final RestDocumentationResponse responseDocument = response() .responseBodyField( fieldWithPath("tables").type(ARRAY).description("멤버의 토론 테이블들"), + fieldWithPath("tables[].id").type(NUMBER).description("토론 테이블 ID (토론 타입 별로 ID를 가짐)"), fieldWithPath("tables[].name").type(STRING).description("토론 테이블 이름"), fieldWithPath("tables[].type").type(STRING).description("토론 타입"), fieldWithPath("tables[].duration").type(NUMBER).description("소요 시간 (초)") @@ -104,8 +105,8 @@ class GetTables { @Test void 테이블_조회_성공() { TableResponses response = new TableResponses(List.of( - new TableResponse("토론 테이블 1", TableType.PARLIAMENTARY, 1800), - new TableResponse("토론 테이블 2", TableType.PARLIAMENTARY, 2000) + new TableResponse(1L, "토론 테이블 1", TableType.PARLIAMENTARY, 1800), + new TableResponse(2L, "토론 테이블 2", TableType.PARLIAMENTARY, 2000) )); when(memberService.getTables(EXIST_MEMBER_ID)).thenReturn(response);