Skip to content

Commit 3109a93

Browse files
authored
Merge pull request #112 from Recipe-Project/feature/add_recipe_info
feat: 레시피 상세 조회 시 게시자 프로필 이미지, 공개 여부 정보 추가
2 parents eda88b1 + 5c369c3 commit 3109a93

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/java/com/recipe/app/src/recipe/application/dto/RecipeDetailResponse.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ public class RecipeDetailResponse {
3939
private final Long postUserId;
4040
@Schema(description = "게시자명")
4141
private final String postUserName;
42+
@Schema(description = "게시자 프로필 이미지")
43+
private final String postUserProfileImage;
4244
@Schema(description = "신고 여부")
4345
private final Boolean isReported;
46+
@Schema(description = "공개 여부")
47+
private final Boolean isHidden;
4448

4549
@Builder
4650
public RecipeDetailResponse(Long recipeId, String recipeName, String introduction, String thumbnailImgUrl, Long cookingTime, String level,
4751
List<RecipeIngredientResponse> recipeIngredients, List<RecipeProcessResponse> recipeProcesses,
48-
Boolean isUserScrap, long scrapCnt, long viewCnt, Long postUserId, String postUserName, Boolean isReported) {
52+
Boolean isUserScrap, long scrapCnt, long viewCnt, Long postUserId, String postUserName, String postUserProfileImage,
53+
Boolean isReported, Boolean isHidden) {
4954

5055
this.recipeId = recipeId;
5156
this.recipeName = recipeName;
@@ -60,7 +65,9 @@ public RecipeDetailResponse(Long recipeId, String recipeName, String introductio
6065
this.viewCnt = viewCnt;
6166
this.postUserId = postUserId;
6267
this.postUserName = postUserName;
68+
this.postUserProfileImage = postUserProfileImage;
6369
this.isReported = isReported;
70+
this.isHidden = isHidden;
6471
}
6572

6673
public static RecipeDetailResponse from(Recipe recipe, boolean isUserScrap, User postUser, List<String> ingredientNamesInFridge) {
@@ -85,7 +92,9 @@ public static RecipeDetailResponse from(Recipe recipe, boolean isUserScrap, User
8592
.viewCnt(recipe.getViewCnt())
8693
.postUserId(postUser != null ? postUser.getUserId() : null)
8794
.postUserName(postUser != null ? postUser.getNickname() : null)
95+
.postUserProfileImage(postUser != null ? postUser.getProfileImgUrl() : null)
8896
.isReported(recipe.isReported())
97+
.isHidden(recipe.isHidden())
8998
.build();
9099
}
91100
}

0 commit comments

Comments
 (0)