Skip to content

[FEAT] 6주차 미션_사이먼#21

Open
hoondongseo wants to merge 12 commits intosimonfrom
week6-simon
Open

[FEAT] 6주차 미션_사이먼#21
hoondongseo wants to merge 12 commits intosimonfrom
week6-simon

Conversation

@hoondongseo
Copy link
Copy Markdown
Contributor

@hoondongseo hoondongseo commented May 4, 2026

📂 관련 이슈

  • closes #[이슈 번호]

🛠️ 작업 사항

  • [ Entity 제작 & 매핑 ]
  • [ 홈 화면/미션/마이페이지/리뷰 관련 쿼리 로직 반영 ]
  • [ 엔드포인트 변경 및 정리 ]

📸 관련 이미지 (스크린샷 또는 동영상)

리뷰 작성

image image image

마이페이지 조회

image image image

진행 중, 진행 완료한 미션 조회

image image image

홈 화면 조회

image image image ---

💬 기타 설명

💡 추가적으로 공유할 내용이나 리뷰어에게 전달할 사항이 있다면 작성해 주세요.

@taehyeon1998
Copy link
Copy Markdown
Contributor

전반적으로 코드를 되게 잘 짜준것 같아. 특히 쿼리 부분은 나도 이런 방법도 있구나 라는걸 알게 해준 것 같아.
그리고 추가적으로 그냥 하는 말인데 나는 service 부분을 구현할때 service랑 serviceImpl을 따로 두어서 추상화 부분과 구현체 부분을 나누어 만들어놨어. 처음에 배울때 구현체에 의존하도록 하지 말고 추상화에 의존하도록 설계하라고 배운게 생각났거든. 이 부분은 한번 고민해 보면 좋을 것 같아

private String phoneNumber;

@Column(name = "profile_url")
@Column(name = "profile_url", nullable = false)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나 같은 경우는 프로필 사진은 null이 가능하도록 했어. 프로필 설정 안하는 사람도 많다고 생각해서 null허용하고 나중에 기본값을 주면 된다고 생각했거든. 이건 그냥 생각의 차이인것 같긴 해

@OneToMany(mappedBy = "member", cascade = CascadeType.REMOVE)
private List<MemberPreferFood> memberPreferFoodList = new ArrayList<>();

@OneToMany(mappedBy = "member", cascade = CascadeType.REMOVE, orphanRemoval = true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orphanRemoval = true 이게 뭔지 모르겠어서 스터디때 설명해주면 좋을 것 같아. 위에 MemberPreferFood랑 양방향 참조 할때는 사용 하지 않았고 여기서는 사용했는데 이 이유도 궁금하다

@Transactional
public ReviewResDTO.CreateReview createReview(Long storeId, ReviewReqDTO.CreateReview dto) {
Store store = storeRepository.findById(storeId)
.orElseThrow(() -> new StoreException(StoreErrorCode.MEMBER_NOT_FOUND));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서는 MEMBER_NOT_FOUND 보다는 STORE_NOT_FOUND를 에러코드로 보내주는게 맞는 것 같아


Review saved = reviewRepository.save(review);

return ReviewResDTO.CreateReview.builder()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 return으로 ResDTO에 직접 다시 값을 반환했던데 우리 컨버터 만들었었잖아? 리턴을 컨버로 주는 방법으로도 한번 해보는 경험을 해보면 좋을 듯

where mm.member.id = :memberId
and mm.status = :status
order by mm.updatedAt desc
""")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 나는 workbook에서 배운 fetch join을 안쓰고 처음부터 DTO에서 조회해서 사용하는 방식을 사용했네. 이제 내가 앞서 피드백했던 컨버터를 쓰지 않았던 이유가 보이기 시작했다. 단순 조회에서는 이 방법이 좋은 방법인 것 같아.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants