Skip to content

7주차 미션 [워니]#15

Open
ywkim1m wants to merge 13 commits into
mainfrom
wony/week7
Open

7주차 미션 [워니]#15
ywkim1m wants to merge 13 commits into
mainfrom
wony/week7

Conversation

@ywkim1m
Copy link
Copy Markdown
Collaborator

@ywkim1m ywkim1m commented May 13, 2026

📌 구현 결과

1. 내가 진행중인 미션 조회 API 구현

  • 오프셋 기반 페이지네이션 적용
  • MissionStatus 기준 진행중 미션 필터링
  • PageRequest 기반 조회 구현
  • MemberMission 기준으로 미션 조회 로직 수정

2. 내가 작성한 리뷰 조회 API 구현

  • 커서 기반 페이지네이션 적용
  • ID 순 / SCORE 순 정렬 모두 구현
  • 커서 구조 직접 구현 (score:id, id)
  • 다음 cursor 계산 및 hasNext 응답 추가
  • 리뷰 이미지 제외 후 응답 DTO 구성
  • Review ↔ Mission ↔ Store 연관관계 기반 데이터 조회

3. 가게 미션 생성 및 조회 API 구현

  • Store 조회 후 Mission 생성 로직 구현
  • MissionConverter 추가
  • StoreException / StoreErrorCode 추가
  • 가게별 미션 커서 기반 조회 구현

4. Request Body 검증 로직 추가

  • MissionCreateRequest
    ReviewReqDTO(추가 필요)
    SignUpReqDTO(추가 필요)

위 DTO들에 검증 어노테이션 추가

@NotBlank
@NotNull
@Min
@Future
@Size

적용 및 커스텀 메시지 설정

5. 전역 예외 처리 추가

GeneralExceptionAdvice에 MethodArgumentNotValidException 핸들러 추가
검증 실패 시 field명 + 실패 이유를 Map 형태로 응답하도록 수정

❓ 리뷰 요청

🤔 질문

💬 기타 공유 사항

진행중 미션 조회

  • 사용자가 특정 페이지로 이동하는 성격
  • offset 기반(Page) 적용

리뷰 조회

  • 데이터 누락/중복 최소화를 위해 cursor 기반 적용

@ochyeon
Copy link
Copy Markdown
Collaborator

ochyeon commented May 14, 2026

미션 수고하셨습니다!

Copy link
Copy Markdown
Collaborator

@KateteDeveloper KateteDeveloper left a comment

Choose a reason for hiding this comment

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

미션 수고 많으셨습니다~!

Copy link
Copy Markdown
Member

@yangjiae12 yangjiae12 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!


return CursorPageResponse.<ReviewResDTO.MyReviewResponse>builder()
.content(content)
.hasNext(reviews.size() == size)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

조회 결과가 size와 같다고 해서 항상 다음 페이지가 있는 것은 아니므로, size + 1개 조회하거나 Slice를 사용해 hasNext를 판단하면 더 정확할 것 같습니다.

Pageable pageable = PageRequest.of(0, size);
List<Review> reviews;

if ("SCORE".equalsIgnoreCase(sort)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

잘못된 sort 값도 id 정렬로 처리될 수 있어, 허용된 정렬값인지 검증하면 API 동작이 더 명확할 것 같습니다.

@RestController
@RequiredArgsConstructor
@RequestMapping("/reviews")
public class ReviewController {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

리뷰 작성 외의 다른 API도 컨트롤러까지 작성해주세요!

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.

4 participants