Skip to content

Commit

Permalink
fix: member info get 정보 추가 (#111)
Browse files Browse the repository at this point in the history
Co-authored-by: yuuddin <[email protected]>
  • Loading branch information
yuuddin and yuuddin authored Aug 30, 2024
1 parent 47792d8 commit e9c1ff3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ public class MemberInfoDTO {
String username;
String nickname;
Language language;
String mainCategory;
String subCategory;
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,17 @@ public Boolean memberIdDuplicate(String loginId) {
}

public MemberInfoDTO getMemberInfo(Member member){
Optional<SubPrefer> subPrefer = subPreferRepository.findByMember(member);
if(subPrefer.isEmpty()){
throw new UserHandler(ErrorCode.SUBCATEGORY_NOT_EXIST);
}
return MemberInfoDTO.builder()
.loginId(member.getLoginId())
.language(member.getLanguage())
.nickname(member.getNickname())
.username(member.getUsername())
.mainCategory(subPrefer.get().getSubCategory().getMainCategory().getKrSubCategory())
.subCategory(subPrefer.get().getSubCategory().getName())
.build();
}

Expand Down

0 comments on commit e9c1ff3

Please sign in to comment.