Skip to content

Commit 3a0ed45

Browse files
authored
Merge pull request #132 from SWU-Elixir/feat/3-recipe-CRUD
feat: RecipeDetailResponseDTO에 작성자 멤버 ID 필드 추가
2 parents 0808856 + 1c57c48 commit 3a0ed45

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ ResponseEntity<CommonResponse<?>> createRecipe(
118118
"id": 1,
119119
"authorNickname": "mj",
120120
"authorTitle": "비타민 수호자",
121+
"authorId": 1,
121122
"authorProfileUrl": "https://recipePostUserImage.com",
122123
"title": "방울토마토 소박이",
123124
"imageUrl": "http://www.foodsafetykorea.go.kr/uploadimg/cook/10_00031_1.png",

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 Long authorId; // 작성자의 아이디
2425
private String authorProfileUrl; // 레시피 작성자의 프로필이미지
2526
private Boolean authorFollowByCurrentUser; // 현재 사용자가 작성자를 팔로우했는지 여부
2627
private String title;
@@ -57,6 +58,7 @@ public RecipeDetailResponseDTO(Recipe recipe, Boolean authorFollowByCurrentUser,
5758
this.id = recipe.getId();
5859
this.authorNickname = recipe.getMember().getNickname();
5960
this.authorTitle = recipe.getMember().getTitle();
61+
this.authorId = recipe.getMember().getId();
6062
this.authorProfileUrl = recipe.getMember().getProfileUrl();
6163
this.authorFollowByCurrentUser = authorFollowByCurrentUser;
6264
this.title = recipe.getTitle();

0 commit comments

Comments
 (0)