Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wkzb 398 :art 내집다방 조회 API 정보 수정 #180

Merged
merged 6 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,14 @@ public static MemberResponseDto.FollowerListDto toFollowerListDto(Page<Follow> f
.build();
}

public static MemberResponseDto.MyZipdabangDto toMyZipdabangDto(Member member, boolean checkSelf, boolean isFollowing,MemberResponseDto.MemberPreferCategoryDto memberPreferCategoryDto) {
public static MemberResponseDto.MyZipdabangDto toMyZipdabangDto(Member member, boolean checkSelf, boolean isFollowing, boolean isFollower, MemberResponseDto.MemberPreferCategoryDto memberPreferCategoryDto) {

return MemberResponseDto.MyZipdabangDto.builder()
.memberId(member.getMemberId())
.imageUrl(member.getProfileUrl())
.checkSelf(checkSelf)
.checkFollowing(isFollowing)
.checkFollower(isFollower)
.nickname(member.getNickname())
.caption(member.getCaption())
.memberPreferCategoryDto(memberPreferCategoryDto)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/zipdabang/server/service/RecipeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public interface RecipeService {
RecipeResponseDto.RecipePageListDto getLikeRecipes(Integer page, Member member);
RecipeResponseDto.RecipePageListDto getScrapRecipes(Integer page, Member member);


Page<TempRecipe> getTempRecipeList(Integer pageIndex, Member member);

Recipe update(Long recipeId, RecipeRequestDto.UpdateRecipeDto request, MultipartFile thumbnail, List<MultipartFile> stepImages, Member member) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,22 +470,19 @@ public Boolean checkFollowing(Member loginMember, Member targetMember) {
public MemberResponseDto.MyZipdabangDto getMyZipdabang(Member member, Long targetId) {
Member target = memberRepository.findById(targetId).orElseThrow(() -> new MemberException(CommonStatus.MEMBER_NOT_FOUND));
boolean checkSelf = false;
boolean isFollowing = false;
if (member.getMemberId() == target.getMemberId()) {
checkSelf=true;
}
else if(blockedMemberRepository.existsByOwnerAndBlocked(member,target)){
throw new MemberException(CommonStatus.BLOCKED_MEMBER);
}

if (followRepository.existsByFollowerAndFollowee(member, target)) {
isFollowing=true;
}
boolean isFollowing = followRepository.existsByFollowerAndFollowee(member, target);
boolean isFollower = followRepository.existsByFollowerAndFollowee(target, member);

List<Category> categories = findMemberPreferCategories(member);
MemberResponseDto.MemberPreferCategoryDto memberPreferCategoryDto = MemberConverter.toMemberPreferCategoryDto(categories);

return MemberConverter.toMyZipdabangDto(target, checkSelf, isFollowing, memberPreferCategoryDto);
return MemberConverter.toMyZipdabangDto(target, checkSelf, isFollowing, isFollower, memberPreferCategoryDto);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,4 +833,5 @@ public RecipeResponseDto.RecipePageListDto getScrapRecipes(Integer page, Member
Page<Recipe> scrapRecipes = scrapRepository.findRecipeByMember(member, PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "createdAt")));
return RecipeConverter.toPagingRecipeDtoList(scrapRecipes, member);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -817,4 +817,5 @@ else if (page < 1)

return ResponseDto.of(recipeService.getScrapRecipes(page, member));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ public static class MyZipdabangDto{
String imageUrl;
boolean checkSelf;
boolean checkFollowing;
boolean checkFollower;
String nickname;
String caption;
MemberPreferCategoryDto memberPreferCategoryDto;
Expand Down
Loading