From b653db253eb6f2a754f9bf4065e8b056fb41d211 Mon Sep 17 00:00:00 2001 From: waterfog9580 Date: Tue, 9 Aug 2022 18:36:20 +0900 Subject: [PATCH] =?UTF-8?q?[BM-289]=20:adhesive=5Fbandage:=20userId=20->?= =?UTF-8?q?=20username=20=EC=9C=BC=EB=A1=9C=20=EC=9D=91=EB=8B=B5=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/controller/dto/ChatRoomSelectResponse.java | 10 +++++++--- .../chat/controller/ChatRoomApiControllerTest.java | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/saiko/bidmarket/chat/controller/dto/ChatRoomSelectResponse.java b/src/main/java/com/saiko/bidmarket/chat/controller/dto/ChatRoomSelectResponse.java index e17dc3be..976873ef 100644 --- a/src/main/java/com/saiko/bidmarket/chat/controller/dto/ChatRoomSelectResponse.java +++ b/src/main/java/com/saiko/bidmarket/chat/controller/dto/ChatRoomSelectResponse.java @@ -44,8 +44,10 @@ public class ChatRoomSelectResponse { @Builder(access = PRIVATE) @RequiredArgsConstructor(access = PRIVATE) private static class ProductInfo { + @Positive private final long productId; + @NotBlank private final String thumbnailImg; } @@ -55,8 +57,10 @@ private static class ProductInfo { @Builder(access = PRIVATE) @RequiredArgsConstructor(access = PRIVATE) private static class OpponentUserInfo { - @Positive - private final long userId; + + @NotBlank + private final String username; + @NotBlank private final String profileImg; } @@ -76,7 +80,7 @@ public static ChatRoomSelectResponse of( .build(); OpponentUserInfo opponentUserInfo = OpponentUserInfo.builder() - .userId(opponent.getId()) + .username(opponent.getUsername()) .profileImg(opponent.getProfileImage()) .build(); diff --git a/src/test/java/com/saiko/bidmarket/chat/controller/ChatRoomApiControllerTest.java b/src/test/java/com/saiko/bidmarket/chat/controller/ChatRoomApiControllerTest.java index 21465e93..d61529d7 100644 --- a/src/test/java/com/saiko/bidmarket/chat/controller/ChatRoomApiControllerTest.java +++ b/src/test/java/com/saiko/bidmarket/chat/controller/ChatRoomApiControllerTest.java @@ -100,8 +100,8 @@ void ItResponseChatRoomList() throws Exception { .type(JsonFieldType.NUMBER).description("상품 번호"), fieldWithPath("[].productInfo.thumbnailImg") .type(JsonFieldType.STRING).description("상품 이미지"), - fieldWithPath("[].opponentUserInfo.userId") - .type(JsonFieldType.NUMBER).description("상대방 유저 아이디"), + fieldWithPath("[].opponentUserInfo.username") + .type(JsonFieldType.STRING).description("상대방 유저명"), fieldWithPath("[].opponentUserInfo.profileImg") .type(JsonFieldType.STRING).description("상대방 유저 프로필"), fieldWithPath("[].lastMessage")