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")