-
Notifications
You must be signed in to change notification settings - Fork 12
[9,10주차/밤하늘] 워크북 제출합니다. #62
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
base: bamhaneul/main
Are you sure you want to change the base?
Conversation
List<MissionResponseDTO.MissionDTO> userMissionDTOList = userMissionList.stream() | ||
.map(MissionConverter::toMissionDTO).collect(Collectors.toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 리스트로 안 받고, Page로 받으면 밑에서 따로 Page 관련 값들 세팅 안 해도 돼서 더 효율적일 것 같아요 !
Page<MissionResponseDTO.MissionDTO> userMissionDTOPage = userMissionList.map(MissionConverter::toMissionDTO);
Mission mission = missionRepository.findById(missionId).orElseThrow( | ||
() -> new GeneralException(ErrorStatus.MISSION_NOT_FOUND) | ||
); | ||
|
||
User user = userRepository.findById(userId).orElseThrow( | ||
() -> new GeneralException(ErrorStatus.USER_NOT_FOUND) | ||
); | ||
|
||
UserMission userMission = userMissionRepository.findByUserAndMission(user, mission).orElseThrow( | ||
() -> new GeneralException(ErrorStatus.USERMISSION_NOT_FOUND) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엔티티 대신 storeId, memberId로 조회하는 게 더 효율적일 것 같아요 !
findByUserIdAndMissionid(userId, missionId)
() -> new GeneralException(ErrorStatus.RESTAURANT_NOT_FOUND) | ||
); | ||
|
||
Page<Mission> missionPage = missionRepository.findAllByRestaurant(restaurant, PageRequest.of(page, 10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
페이징 기본 크기가 10이긴 한데, 프론트에서 혹시 다른 값을 요청할 수도 있으니 size 값도 받는 게 좋을 것 같아요 !
밤하늘 고생하셨습니다 ! |
밤하늘 고생하셨습니다 ! |
✅ 실습 체크리스트
✅ 컨벤션 체크리스트
📌 주안점