Skip to content

[week07] 쟁챌딱 7주차 미션#20

Open
heesik03 wants to merge 4 commits into
mainfrom
week07_jaengchalttak
Open

[week07] 쟁챌딱 7주차 미션#20
heesik03 wants to merge 4 commits into
mainfrom
week07_jaengchalttak

Conversation

@heesik03
Copy link
Copy Markdown
Contributor

UMC 스프링 부트 7주 차 미션 오프셋, 커서 기반 페이지네이션과 유효성 검증 어노테이션으로 검증입니다.
오프셋 기반 페이징은 몇 번 해봐서 익숙하지만, 커서 기반은 낯설어서 여러 번 다뤄봐야 할 거 같습니다.

1. 내가 진행중인 미션 조회하기 (오프셋 기반)

내가 진행 중인 미션 조회

2. 내가 생성한 리뷰들 조회하기 (커서 기반)

ID 기준

내 리뷰 조회 Swagger 1_1 내 리뷰 조회 Swagger 1_2

별점 기준

내 리뷰 조회 Swagger 2_1 내 리뷰 조회 Swagger 2_2

3. Request Body가 있는 API에 검증 어노테이션 붙혀 검증하기

유효성 검증 예외 Swagger

@heesik03 heesik03 requested a review from yousung1020 May 12, 2026 01:19
@heesik03 heesik03 self-assigned this May 12, 2026
Copy link
Copy Markdown
Contributor

@yousung1020 yousung1020 left a comment

Choose a reason for hiding this comment

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

전반적으로 워크북의 내용을 잘 숙지하신 것 같습니다! 공들여서 미션을 진행하신게 티가 납니다! 다음 피드백 사항만 적용되면 더욱 좋을 것 같아요! 수고하셨습니다~~

Comment on lines +29 to +31
.commentId(ownerComment != null ? ownerComment.getId() : null)
.commentContent(ownerComment != null ? ownerComment.getCommentContent() : null)
.commentCreateAt(ownerComment != null ? ownerComment.getCreatedAt() : null)
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.

빌더 패턴 안에 표현식을 적용하기 보단, 가독성을 위해 빌더를 호출하기 전에 값을 확정 짓는 것이 좋아보입니다!


// ID 기준 페이징
@Query("SELECT r FROM StoreReview r " +
"JOIN FETCH r.user u JOIN FETCH r.store s " +
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.

r.user u 나 r.store s 처럼 fetch join 대상에 대한 별칭을 주는 것은 객체 그래프의 정합성이 깨질 위험이 있어 권장되지 않습니다!(JPA 표준 사양) 하지만 다행히도 코드에서는 별칭으로 조건절을 구성하진 않으셨지만(u.id, s.id 등), 그럼에도 u나 s 같은 별칭은 제거하시는게 좋아보입니다!

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.

전반적으로 응답을 보내기 전/후에 로그를 남기시면 좋을 것 같아요! 또한 추가된 두 개의 handleMethodArgumentNotValidException, handleConstraintViolationException 핸들러 메서드의 구조가 유사하므로 중복되는 로직은 private한 헬퍼 메서드로 빼두시는 것이 좋아보입니다!

@junjinyun
Copy link
Copy Markdown
Contributor

junjinyun commented May 17, 2026

각 미션 결과 이미지 별로 개요 넣어서 보기 좋게 해 주셔서 좋았고
추후에 DTO에 @Schema(description = "평점 (0.5 ~ 5.0)", example = "4.5") 와 같은 식으로 해당 값이 어떤 값 이고 예시 값은 어떤것이 들어가는지도 명시하면 추후 테스트 하거나 프론트 와 소통 할 때 좋아보입니다.

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.

3 participants