Skip to content

Commit c88fc5f

Browse files
authored
Merge pull request #129 from SWU-Elixir/feat/3-recipe-CRUD
feat: 레시피 상세 조회 응답에 레시피 작성자의 프로필 URL 필드 추가
2 parents 0ef8294 + 97e02fe commit c88fc5f

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/main/java/BE_Elixir/Elixir/domain/recipe/controller/api/RecipeApi.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,24 @@ ResponseEntity<CommonResponse<?>> createRecipe(
101101
"message": "레시피 조회 성공",
102102
"data": {
103103
"authorFollowByCurrentUser": false,
104-
"comments": [],
105-
"likedByCurrentUser": false,
106-
"scrappedByCurrentUser": false,
107-
"id": 3,
108-
"authorNickname": "mj",
109-
"authorTitle": null,
104+
"comments": [
105+
{
106+
"commentId": 1,
107+
"recipeId": 1,
108+
"nickName": "mj",
109+
"title": "비타민 수호자",
110+
"authorProfileUrl": "https://commentPostUserImage.com",
111+
"content": "mj로 댓글달기",
112+
"createdAt": "2025-06-17T07:52:47",
113+
"updatedAt": "2025-06-17T07:52:47"
114+
}
115+
],
116+
"likedByCurrentUser": false,
117+
"scrappedByCurrentUser": false,
118+
"id": 1,
119+
"authorNickname": "mj",
120+
"authorTitle": "비타민 수호자",
121+
"authorProfileUrl": "https://recipePostUserImage.com",
110122
"title": "방울토마토 소박이",
111123
"imageUrl": "http://www.foodsafetykorea.go.kr/uploadimg/cook/10_00031_1.png",
112124
"description": "기타",

src/main/java/BE_Elixir/Elixir/domain/recipe/dto/response/RecipeDetailResponseDTO.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class RecipeDetailResponseDTO {
2121
private Long id;
2222
private String authorNickname; // 작성자의 닉네임
2323
private String authorTitle; // 작성자의 칭호
24+
private String authorProfileUrl; // 레시피 작성자의 프로필이미지
2425
private Boolean authorFollowByCurrentUser; // 현재 사용자가 작성자를 팔로우했는지 여부
2526
private String title;
2627
private String imageUrl;
@@ -56,6 +57,7 @@ public RecipeDetailResponseDTO(Recipe recipe, Boolean authorFollowByCurrentUser,
5657
this.id = recipe.getId();
5758
this.authorNickname = recipe.getMember().getNickname();
5859
this.authorTitle = recipe.getMember().getTitle();
60+
this.authorProfileUrl = recipe.getMember().getProfileUrl();
5961
this.authorFollowByCurrentUser = authorFollowByCurrentUser;
6062
this.title = recipe.getTitle();
6163
this.imageUrl = recipe.getImageUrl();

0 commit comments

Comments
 (0)