Skip to content

Commit

Permalink
โ™ป๏ธ add recipe image to comment list
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxrxn committed Dec 23, 2024
1 parent 1c54694 commit c3db676
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public record CommentOfUserResponse(
long commentId,
long recipeId,
String recipeTitle,
String recipeThumbnail,
LocalDateTime createdAt,
String message) {

Expand All @@ -15,6 +16,7 @@ public CommentOfUserResponse(Comment comment) {
comment.getId(),
comment.getRecipe().getId(),
comment.getRecipe().getTitle(),
comment.getRecipe().getThumbnail(),
comment.getCreatedAt(),
comment.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ void readCommentsOfUserV1() {
fieldWithPath("[].commentId").description("๋Œ“๊ธ€ ์•„์ด๋””"),
fieldWithPath("[].recipeId").description("๋ ˆ์‹œํ”ผ ์•„์ด๋””"),
fieldWithPath("[].recipeTitle").description("๋ ˆ์‹œํ”ผ ์ œ๋ชฉ"),
fieldWithPath("[].recipeThumbnail").description("๋ ˆ์‹œํ”ผ ์ธ๋„ค์ผ"),
fieldWithPath("[].createdAt").description("์ž‘์„ฑ ์‹œ๊ฐ„"),
fieldWithPath("[].message").description("๋‚ด์šฉ")
)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ void deleteCommentsByUser() {
void readCommentsOfUser() {
UserInfo userInfo = new UserInfo(2, "[email protected]");
List<CommentOfUserResponse> expect = List.of(
new CommentOfUserResponse(1L, 1L, "๊น€๋ฐฅ", LocalDateTime.of(2024, 1, 1, 0, 0, 0), "great"),
new CommentOfUserResponse(3L, 2L, "๊น€์น˜์ฐŒ๊ฐœ", LocalDateTime.of(2024, 5, 5, 0, 0, 0), "good")
new CommentOfUserResponse(1L, 1L, "๊น€๋ฐฅ", "๊น€๋ฐฅ์ด๋ฏธ์ง€.jpg", LocalDateTime.of(2024, 1, 1, 0, 0, 0), "great"),
new CommentOfUserResponse(3L, 2L, "๊น€์น˜์ฐŒ๊ฐœ", "๊น€์น˜์ฐŒ๊ฐœ์ด๋ฏธ์ง€.jpg", LocalDateTime.of(2024, 5, 5, 0, 0, 0), "good")
);

List<CommentOfUserResponse> actual = commentService.readCommentsOfUserV1(userInfo);
Expand Down

0 comments on commit c3db676

Please sign in to comment.