From 36af106d902bd4b137ddaaa093e9eb13156f5750 Mon Sep 17 00:00:00 2001 From: seunghaLim Date: Sun, 22 Sep 2024 20:43:02 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE]=20MemberService=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gunbbang/controller/MemberController.java | 9 +- .../org/gunbbang/service/BakeryService.java | 113 ------------ .../org/gunbbang/service/MemberService.java | 144 +-------------- .../gunbbang/service/MemberTypeService.java | 170 ++++++++++++++++++ .../repository/MemberBreadTypeRepository.java | 4 + .../MemberNutrientTypeRepository.java | 3 + 6 files changed, 185 insertions(+), 258 deletions(-) create mode 100644 api/src/main/java/com/org/gunbbang/service/MemberTypeService.java diff --git a/api/src/main/java/com/org/gunbbang/controller/MemberController.java b/api/src/main/java/com/org/gunbbang/controller/MemberController.java index 23c4b05..6217b37 100644 --- a/api/src/main/java/com/org/gunbbang/controller/MemberController.java +++ b/api/src/main/java/com/org/gunbbang/controller/MemberController.java @@ -11,6 +11,8 @@ import com.org.gunbbang.service.BakeryService; import com.org.gunbbang.service.MemberService; import com.org.gunbbang.service.ReviewService; +import com.org.gunbbang.service.*; + import java.util.List; import java.util.Map; import jakarta.servlet.http.HttpServletResponse; @@ -29,11 +31,12 @@ public class MemberController { private final BakeryService bakeryService; private final JwtService jwtService; private final AmplitudeService amplitudeService; + private final MemberTypeService memberTypeService; @GetMapping(value = "", name = "유저_상세정보_조회") @ResponseStatus(HttpStatus.OK) public ApiResponse getMemberDetail() { - MemberDetailResponseDTO memberDetailResponseDto = memberService.getMemberDetail(); + MemberDetailResponseDTO memberDetailResponseDto = memberTypeService.getMemberDetail(); return ApiResponse.success(SuccessType.GET_MYPAGE_SUCCESS, memberDetailResponseDto); } @@ -44,14 +47,14 @@ public ApiResponse updateMemberTypes( String nickname = SecurityUtil.getLoginMemberNickname(); return ApiResponse.success( SuccessType.UPDATE_MEMBER_TYPES_SUCCESS, - memberService.updateMemberTypes(request, memberId, nickname)); + memberTypeService.updateMemberTypes(request, memberId, nickname)); } @GetMapping(value = "/types", name = "유저_필터칩_조회") public ApiResponse getMemberTypes() { Map loginMemberInfo = SecurityUtil.getLoginMemberInfo(); return ApiResponse.success( - SuccessType.GET_MEMBER_TYPES_SUCCESS, memberService.getMemberTypes(loginMemberInfo)); + SuccessType.GET_MEMBER_TYPES_SUCCESS, memberTypeService.getMemberTypes(loginMemberInfo)); } @GetMapping(value = "/reviews", name = "유저_리뷰_목록_조회") diff --git a/api/src/main/java/com/org/gunbbang/service/BakeryService.java b/api/src/main/java/com/org/gunbbang/service/BakeryService.java index fb1981c..5e7ca84 100644 --- a/api/src/main/java/com/org/gunbbang/service/BakeryService.java +++ b/api/src/main/java/com/org/gunbbang/service/BakeryService.java @@ -27,130 +27,17 @@ @Transactional @RequiredArgsConstructor public class BakeryService { - private final CategoryRepository categoryRepository; private final BookMarkRepository bookMarkRepository; private final MemberRepository memberRepository; private final BakeryRepository bakeryRepository; private final MenuRepository menuRepository; - private final BreadTypeRepository breadTypeRepository; private final MemberBreadTypeRepository memberBreadTypeRepository; private final MemberNutrientTypeRepository memberNutrientTypeRepository; private final BakeryBreadTypeRepository bakeryBreadTypeRepository; - private final NutrientTypeRepository nutrientTypeRepository; private final String BLANK_SPACE = " "; private final int MAX_BEST_BAKERY_COUNT = 10; - // public Page getBakeryList( - // String sortingOption, - // boolean personalFilter, - // boolean isHard, - // boolean isDessert, - // boolean isBrunch, - // PageRequest pageRequest) { - // List categoryList = getCategoryList(isHard, isDessert, isBrunch); - // Long memberId = personalFilter ? SecurityUtil.getUserId().orElse(null) : null; - // - // Page bakeryList = - // getFilteredAndSortedBakeryList( - // personalFilter, categoryList, sortingOption, memberId, pageRequest); - // return getBakeryListResponseDTOList(bakeryList); - // } - // - // private List getCategoryList(boolean isHard, boolean isDessert, boolean isBrunch) { - // List categoryList = new ArrayList<>(); - // - // Map categoryMap = new HashMap<>(); - // categoryMap.put(CategoryType.HARD_BREAD, isHard); - // categoryMap.put(CategoryType.DESSERT, isDessert); - // categoryMap.put(CategoryType.BRUNCH, isBrunch); - // - // for (Map.Entry entry : categoryMap.entrySet()) { - // if (entry.getValue()) { // true인 값만 해당되어 category에 추가된다 - // Category category = - // categoryRepository - // .findByCategoryName(entry.getKey().getName()) - // .orElseThrow( - // () -> - // new NotFoundException( - // ErrorType.NOT_FOUND_CATEGORY_EXCEPTION, - // ErrorType.NOT_FOUND_CATEGORY_EXCEPTION.getMessage() - // + entry.getKey().getName())); - // categoryList.add(category); - // } - // } - // - // if (categoryList.isEmpty()) { // 카테고리가 빈 경우 - // for (CategoryType categoryType : CategoryType.values()) { - // Category category = - // categoryRepository - // .findByCategoryName(categoryType.getName()) - // .orElseThrow( - // () -> - // new NotFoundException( - // ErrorType.NOT_FOUND_CATEGORY_EXCEPTION, - // ErrorType.NOT_FOUND_CATEGORY_EXCEPTION.getMessage() - // + categoryType.getName())); - // categoryList.add(category); - // } - // } - // - // return categoryList; - // } - - // private Page getFilteredAndSortedBakeryList( - // boolean personalFilter, - // List categoryList, - // String sortingOption, - // Long memberId, - // PageRequest pageRequest) { - // Page getSortedByCategoryBakeryList; - // if (personalFilter) { - // final List memberBreadType = - // memberBreadTypeRepository.findAllByMemberId(memberId); - // - // if (memberBreadType.isEmpty()) { - // throw new NotFoundException( - // ErrorType.REQUEST_VALIDATION_EXCEPTION, - // ErrorType.REQUEST_VALIDATION_EXCEPTION.getMessage()); - // } - // - // final List breadType = - // - // memberBreadType.stream().map(MemberBreadType::getBreadType).collect(Collectors.toList()); - // final List memberNutrientTypes = - // memberNutrientTypeRepository.findAllByMemberId(memberId); - // final MemberNutrientType memberNutrientType = memberNutrientTypes.get(0); - // final NutrientType bakeryNutrientType = memberNutrientType.getNutrientType(); - // - // if ("review".equals(sortingOption)) { - // getSortedByCategoryBakeryList = - // bakeryRepository.findFilteredBakeriesSortByReview( - // categoryList, breadType, bakeryNutrientType, pageRequest); - // return getSortedByCategoryBakeryList; - // } - // getSortedByCategoryBakeryList = - // bakeryRepository.findFilteredBakeries( - // categoryList, breadType, bakeryNutrientType, pageRequest); - // return getSortedByCategoryBakeryList; - // } - - // final List breadType = breadTypeRepository.findAll(); - // NutrientType bakeryNutrientType = - // nutrientTypeRepository.findByNutrientTypeTag(NutrientTypeTag.NOT_OPEN).orElse(null); - // - // if ("review".equals(sortingOption)) { - // getSortedByCategoryBakeryList = - // bakeryRepository.findFilteredBakeriesSortByReview( - // categoryList, breadType, bakeryNutrientType, pageRequest); - // return getSortedByCategoryBakeryList; - // } - // getSortedByCategoryBakeryList = - // bakeryRepository.findFilteredBakeries( - // categoryList, breadType, bakeryNutrientType, pageRequest); - // return getSortedByCategoryBakeryList; - // } - public BakeryDetailResponseDTO getBakeryDetail(Long bakeryId) { final Bakery bakery = bakeryRepository diff --git a/api/src/main/java/com/org/gunbbang/service/MemberService.java b/api/src/main/java/com/org/gunbbang/service/MemberService.java index 50b8f33..4d5b003 100644 --- a/api/src/main/java/com/org/gunbbang/service/MemberService.java +++ b/api/src/main/java/com/org/gunbbang/service/MemberService.java @@ -2,19 +2,13 @@ import com.org.gunbbang.*; import com.org.gunbbang.auth.jwt.service.AppleJwtService; -import com.org.gunbbang.auth.security.util.SecurityUtil; -import com.org.gunbbang.controller.DTO.request.MemberTypesRequestDTO; import com.org.gunbbang.controller.DTO.response.*; import com.org.gunbbang.entity.*; -import com.org.gunbbang.entity.BreadType; import com.org.gunbbang.support.errorType.ErrorType; import com.org.gunbbang.repository.*; import com.org.gunbbang.support.exception.BadRequestException; import com.org.gunbbang.support.exception.NotFoundException; -import com.org.gunbbang.util.mapper.*; -import java.util.ArrayList; import java.util.List; -import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.context.SecurityContextHolder; @@ -28,145 +22,10 @@ public class MemberService { private final MemberRepository memberRepository; - private final BreadTypeRepository breadTypeRepository; - private final NutrientTypeRepository nutrientTypeRepository; private final AppleJwtService appleJWTService; private final BookMarkRepository bookMarkRepository; - private final MemberBreadTypeRepository memberBreadTypeRepository; - private final MemberNutrientTypeRepository memberNutrientTypeRepository; - - public MemberDetailResponseDTO getMemberDetail() { - String memberNickname = SecurityUtil.getLoginMemberNickname(); - MainPurpose memberMainPurpose = SecurityUtil.getLoginMemberMainPurpose(); - // Long memberBreadTypeId = SecurityUtil.getLoginMemberBreadTypeId(); - Member foundMember = - memberRepository - .findByNickname(memberNickname) - .orElseThrow( - () -> - new NotFoundException( - ErrorType.NOT_FOUND_USER_EXCEPTION, - ErrorType.NOT_FOUND_USER_EXCEPTION.getMessage() + memberNickname)); - - List breadType = memberBreadTypeRepository.findAllByMember(foundMember); - List breadTypeResponseDTO = - MemberBreadTypeMapper.INSTANCE.toBreadTypeResponseDTOList(breadType); - - return MemberTypeMapper.INSTANCE.toMemberDetailResponseDTO( - memberNickname, memberMainPurpose, breadTypeResponseDTO); - } - - public MemberTypeResponseDTO updateMemberTypes( - MemberTypesRequestDTO request, Long memberId, String nickname) { - Member foundMember = - memberRepository - .findById(memberId) - .orElseThrow( - () -> - new NotFoundException( - ErrorType.NOT_FOUND_USER_EXCEPTION, - ErrorType.NOT_FOUND_USER_EXCEPTION.getMessage() + memberId)); - - if (memberBreadTypeRepository.existsByMember(foundMember)) { - memberBreadTypeRepository.deleteAllByMember(foundMember); // 기존에 있던 MemberBreadType 전부 삭제 - } - - List memberBreadTypes = - saveBreadTypes(request.getBreadTypeList(), foundMember); - - if (memberNutrientTypeRepository.existsByMember(foundMember)) { - memberNutrientTypeRepository.deleteAllByMember( - foundMember); // 기존에 있던 MemberNutrientType 전부 삭제 - } - - List memberNutrientTypes = - saveNutrientTypes(request.getNutrientTypeList(), foundMember); - - foundMember.updateMainPurpose(request.getMainPurpose()); - memberRepository.saveAndFlush(foundMember); - - List breadTypeResponseDTO = - MemberBreadTypeMapper.INSTANCE.toBreadTypeResponseDTOList(memberBreadTypes); - List nutrientTypeResponseDTO = - MemberNutrientTypeMapper.INSTANCE.toNutrientTypeResponseDTOList(memberNutrientTypes); - - return MemberTypeMapper.INSTANCE.toMemberTypeResponseDTO( - foundMember.getMemberId(), - foundMember.getMainPurpose(), - nickname, - breadTypeResponseDTO, - nutrientTypeResponseDTO); - } - - private List saveBreadTypes(List breadTypeIds, Member foundMember) { - List memberBreadTypes = new ArrayList<>(); - - for (Long breadTypeId : breadTypeIds) { - memberBreadTypes.add(createMemberBreadTypeById(foundMember, breadTypeId)); - } - return memberBreadTypeRepository.saveAllAndFlush(memberBreadTypes); - } - - private MemberBreadType createMemberBreadTypeById(Member foundMember, Long breadTypeId) { - BreadType foundBreadType = - breadTypeRepository - .findByBreadTypeId(breadTypeId) - .orElseThrow(() -> new NotFoundException(ErrorType.NOT_FOUND_BREAD_TYPE_EXCEPTION)); - - MemberBreadType memberBreadType = - MemberBreadType.builder().member(foundMember).breadType(foundBreadType).build(); - return memberBreadType; - } - - private List saveNutrientTypes( - List nutrientTypeIds, Member foundMember) { - List memberNutrientTypes = new ArrayList<>(); - - for (Long nutrientTypeId : nutrientTypeIds) { - memberNutrientTypes.add(createMemberNutrientTypeById(foundMember, nutrientTypeId)); - } - - return memberNutrientTypeRepository.saveAllAndFlush(memberNutrientTypes); - } - - private MemberNutrientType createMemberNutrientTypeById(Member foundMember, Long nutrientTypeId) { - NutrientType foundNutrientType = - nutrientTypeRepository - .findByNutrientTypeId(nutrientTypeId) - .orElseThrow(() -> new NotFoundException(ErrorType.NOT_FOUND_NUTRIENT_EXCEPTION)); - - MemberNutrientType memberNutrientType = - MemberNutrientType.builder().member(foundMember).nutrientType(foundNutrientType).build(); - return memberNutrientType; - } - - public MemberTypeResponseDTO getMemberTypes(Map loginMemberInfo) { - Long memberId = Long.parseLong(loginMemberInfo.get("memberId").toString()); - Member member = - memberRepository - .findById(memberId) - .orElseThrow( - () -> - new NotFoundException( - ErrorType.NOT_FOUND_USER_EXCEPTION, - ErrorType.NOT_FOUND_USER_EXCEPTION.getMessage() + memberId)); - List memberBreadTypes = memberBreadTypeRepository.findAllByMember(member); - List memberNutrientTypes = - memberNutrientTypeRepository.findAllByMemberId(memberId); - - List breadTypeResponseDTO = - MemberBreadTypeMapper.INSTANCE.toBreadTypeResponseDTOList(memberBreadTypes); - List nutrientTypeResponseDTO = - MemberNutrientTypeMapper.INSTANCE.toNutrientTypeResponseDTOList(memberNutrientTypes); - - return MemberTypeMapper.INSTANCE.toMemberTypeResponseDTO( - memberId, - (MainPurpose) loginMemberInfo.get("mainPurpose"), - loginMemberInfo.get("nickname").toString(), - breadTypeResponseDTO, - nutrientTypeResponseDTO); - } + @Transactional(readOnly = true) public ValidationResponseDTO checkDuplicatedNickname(String nickname) { if (memberRepository.findByNickname(nickname).isPresent()) { throw new BadRequestException(ErrorType.ALREADY_EXIST_NICKNAME_EXCEPTION); @@ -175,6 +34,7 @@ public ValidationResponseDTO checkDuplicatedNickname(String nickname) { return ValidationResponseDTO.builder().isAvailable(true).build(); } + @Transactional(readOnly = true) public ValidationResponseDTO checkDuplicatedEmail(String email) { if (!memberRepository.findAllByEmail(email).isEmpty()) { throw new BadRequestException(ErrorType.ALREADY_EXIST_EMAIL_EXCEPTION); diff --git a/api/src/main/java/com/org/gunbbang/service/MemberTypeService.java b/api/src/main/java/com/org/gunbbang/service/MemberTypeService.java new file mode 100644 index 0000000..41d4ad6 --- /dev/null +++ b/api/src/main/java/com/org/gunbbang/service/MemberTypeService.java @@ -0,0 +1,170 @@ +package com.org.gunbbang.service; + +import com.org.gunbbang.MainPurpose; +import com.org.gunbbang.auth.security.util.SecurityUtil; +import com.org.gunbbang.controller.DTO.request.MemberTypesRequestDTO; +import com.org.gunbbang.controller.DTO.response.BreadTypeResponseDTO; +import com.org.gunbbang.controller.DTO.response.MemberDetailResponseDTO; +import com.org.gunbbang.controller.DTO.response.MemberTypeResponseDTO; +import com.org.gunbbang.controller.DTO.response.NutrientTypeResponseDTO; +import com.org.gunbbang.entity.*; +import com.org.gunbbang.repository.*; +import com.org.gunbbang.support.errorType.ErrorType; +import com.org.gunbbang.support.exception.NotFoundException; +import com.org.gunbbang.util.mapper.MemberBreadTypeMapper; +import com.org.gunbbang.util.mapper.MemberNutrientTypeMapper; +import com.org.gunbbang.util.mapper.MemberTypeMapper; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Slf4j +@Service +@RequiredArgsConstructor +public class MemberTypeService { + + private final MemberRepository memberRepository; + private final BreadTypeRepository breadTypeRepository; + private final NutrientTypeRepository nutrientTypeRepository; + private final MemberBreadTypeRepository memberBreadTypeRepository; + private final MemberNutrientTypeRepository memberNutrientTypeRepository; + + @Transactional(readOnly = true) + public MemberDetailResponseDTO getMemberDetail() { + String memberNickname = SecurityUtil.getLoginMemberNickname(); + MainPurpose memberMainPurpose = SecurityUtil.getLoginMemberMainPurpose(); + + Member foundMember = + memberRepository + .findByNickname(memberNickname) + .orElseThrow( + () -> + new NotFoundException( + ErrorType.NOT_FOUND_USER_EXCEPTION, + ErrorType.NOT_FOUND_USER_EXCEPTION.getMessage() + memberNickname)); + + List breadType = memberBreadTypeRepository.findAllByMember(foundMember); + List breadTypeResponseDTO = + MemberBreadTypeMapper.INSTANCE.toBreadTypeResponseDTOList(breadType); + + return MemberTypeMapper.INSTANCE.toMemberDetailResponseDTO( + memberNickname, memberMainPurpose, breadTypeResponseDTO); + } + + @Transactional + public MemberTypeResponseDTO updateMemberTypes( + MemberTypesRequestDTO request, Long memberId, String nickname) { + Member foundMember = + memberRepository + .findById(memberId) + .orElseThrow( + () -> + new NotFoundException( + ErrorType.NOT_FOUND_USER_EXCEPTION, + ErrorType.NOT_FOUND_USER_EXCEPTION.getMessage() + memberId)); + + if (memberBreadTypeRepository.existsByMember(foundMember)) { + memberBreadTypeRepository.deleteAllByMember(foundMember); // 기존에 있던 MemberBreadType 전부 삭제 + } + + List memberBreadTypes = + saveBreadTypes(request.getBreadTypeList(), foundMember); + + if (memberNutrientTypeRepository.existsByMember(foundMember)) { + memberNutrientTypeRepository.deleteAllByMember(foundMember); // 기존에 있던 MemberNutrientType 전부 삭제 + } + + List memberNutrientTypes = + saveNutrientTypes(request.getNutrientTypeList(), foundMember); + + foundMember.updateMainPurpose(request.getMainPurpose()); + memberRepository.saveAndFlush(foundMember); + + List breadTypeResponseDTO = + MemberBreadTypeMapper.INSTANCE.toBreadTypeResponseDTOList(memberBreadTypes); + List nutrientTypeResponseDTO = + MemberNutrientTypeMapper.INSTANCE.toNutrientTypeResponseDTOList(memberNutrientTypes); + + return MemberTypeMapper.INSTANCE.toMemberTypeResponseDTO( + foundMember.getMemberId(), + foundMember.getMainPurpose(), + nickname, + breadTypeResponseDTO, + nutrientTypeResponseDTO); + } + + private List saveBreadTypes(List breadTypeIds, Member foundMember) { + List memberBreadTypes = new ArrayList<>(); + + for (Long breadTypeId : breadTypeIds) { + memberBreadTypes.add(createMemberBreadTypeById(foundMember, breadTypeId)); + } + return memberBreadTypeRepository.saveAllAndFlush(memberBreadTypes); + } + + private MemberBreadType createMemberBreadTypeById(Member foundMember, Long breadTypeId) { + BreadType foundBreadType = + breadTypeRepository + .findByBreadTypeId(breadTypeId) + .orElseThrow(() -> new NotFoundException(ErrorType.NOT_FOUND_BREAD_TYPE_EXCEPTION)); + + MemberBreadType memberBreadType = + MemberBreadType.builder().member(foundMember).breadType(foundBreadType).build(); + return memberBreadType; + } + + private List saveNutrientTypes( + List nutrientTypeIds, Member foundMember) { + List memberNutrientTypes = new ArrayList<>(); + + for (Long nutrientTypeId : nutrientTypeIds) { + memberNutrientTypes.add(createMemberNutrientTypeById(foundMember, nutrientTypeId)); + } + + return memberNutrientTypeRepository.saveAllAndFlush(memberNutrientTypes); + } + + private MemberNutrientType createMemberNutrientTypeById(Member foundMember, Long nutrientTypeId) { + NutrientType foundNutrientType = + nutrientTypeRepository + .findByNutrientTypeId(nutrientTypeId) + .orElseThrow(() -> new NotFoundException(ErrorType.NOT_FOUND_NUTRIENT_EXCEPTION)); + + MemberNutrientType memberNutrientType = + MemberNutrientType.builder().member(foundMember).nutrientType(foundNutrientType).build(); + return memberNutrientType; + } + + @Transactional(readOnly = true) + public MemberTypeResponseDTO getMemberTypes(Map loginMemberInfo) { + Long memberId = Long.parseLong(loginMemberInfo.get("memberId").toString()); + Member member = + memberRepository + .findById(memberId) + .orElseThrow( + () -> + new NotFoundException( + ErrorType.NOT_FOUND_USER_EXCEPTION, + ErrorType.NOT_FOUND_USER_EXCEPTION.getMessage() + memberId)); + List memberBreadTypes = memberBreadTypeRepository.findAllByMember(member); + List memberNutrientTypes = + memberNutrientTypeRepository.findAllByMemberId(memberId); + + List breadTypeResponseDTO = + MemberBreadTypeMapper.INSTANCE.toBreadTypeResponseDTOList(memberBreadTypes); + List nutrientTypeResponseDTO = + MemberNutrientTypeMapper.INSTANCE.toNutrientTypeResponseDTOList(memberNutrientTypes); + + return MemberTypeMapper.INSTANCE.toMemberTypeResponseDTO( + memberId, + (MainPurpose) loginMemberInfo.get("mainPurpose"), + loginMemberInfo.get("nickname").toString(), + breadTypeResponseDTO, + nutrientTypeResponseDTO); + } +} diff --git a/storage/db-core/src/main/java/com/org/gunbbang/repository/MemberBreadTypeRepository.java b/storage/db-core/src/main/java/com/org/gunbbang/repository/MemberBreadTypeRepository.java index 9023568..265d05b 100644 --- a/storage/db-core/src/main/java/com/org/gunbbang/repository/MemberBreadTypeRepository.java +++ b/storage/db-core/src/main/java/com/org/gunbbang/repository/MemberBreadTypeRepository.java @@ -3,6 +3,8 @@ import com.org.gunbbang.entity.Member; import com.org.gunbbang.entity.MemberBreadType; import java.util.List; + +import jakarta.transaction.Transactional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; @@ -11,6 +13,7 @@ public interface MemberBreadTypeRepository extends JpaRepository findAllByMember(Member member); @Query("SELECT mbt FROM MemberBreadType mbt where mbt.member.memberId = :memberId") + @Transactional List findAllByMemberId(Long memberId); boolean existsByMember(Member member); @@ -19,5 +22,6 @@ public interface MemberBreadTypeRepository extends JpaRepository