Skip to content

[7주차/주니] 워크북 제출합니다#35

Merged
LeeJaeJun1 merged 14 commits into
UMC-Inha:junny/mainfrom
LeeJaeJun1:main
May 19, 2026
Merged

[7주차/주니] 워크북 제출합니다#35
LeeJaeJun1 merged 14 commits into
UMC-Inha:junny/mainfrom
LeeJaeJun1:main

Conversation

@LeeJaeJun1
Copy link
Copy Markdown

✅ 실습 체크리스트

  • 이론 학습을 완료하셨나요?
  • 미션 요구사항을 모두 이해하셨나요?
  • 실습을 수행하기 위한 공부를 완료하셨나요?
  • 실습 요구사항을 모두 완료하셨나요?

✅ 컨벤션 체크리스트

  • 디렉토리 구조 컨벤션을 잘 지켰나요?
  • pr 제목을 컨벤션에 맞게 작성하였나요?
  • pr에 해당되는 이슈를 연결하였나요?(중요)
  • 적절한 라벨을 설정하였나요?
  • 파트장에게 code review를 요청하기 위해 reviewer를 등록하였나요?
  • 닉네임/main 브랜치의 최신 상태를 반영하고 있는지 확인했나요?(매우 중요!)

📌 주안점

@LeeJaeJun1 LeeJaeJun1 requested a review from YoungJJun May 12, 2026 02:36
@LeeJaeJun1 LeeJaeJun1 self-assigned this May 12, 2026
@LeeJaeJun1 LeeJaeJun1 linked an issue May 12, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@YoungJJun YoungJJun left a comment

Choose a reason for hiding this comment

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

7주차 피드백

  1. 우선 @Operation 통해서 Swagger 설명 달아주신 점 좋습니다.

  2. (미션) 내가 진행중인 미션 조회하기 → 오프셋 기반 페이지네이션, RequestBody로 사용자 ID받기 미션 제약사항이 있었어요.

    우선 ID를 Body가 아닌 @PathVariable 로 받고 있습니다. 미션 요구사항에서 RequestBody를 요구하고 있지만 이미 프로젝트 한 번 해보셨고 @PathVariable@RequestBody차이점을 알고 있는 상황에서 결국 나중에 토큰으로 바꿀 내용을 시간들여 수정할 필요는 없다고 생각합니다.
    (선택사항으로 수정하셔도 문제는 없습니다.)

    page 값에 대해서 Default는 설정되어 있는데 @Min(0) 같은 annotation 사용해서 음수값에 대해서 예외처리 할 수 있을 것 같아요.

  3. (미션) 내가 생성한 리뷰들 조회하기 → 커서기반, 사진제외, ID/별점순 구현

    ReviewQueryService에서 MissionConverter가 사용되고 있어요. 도메인별로 나눠서 설계한걸 고려하면 의존성이 잘 못 설정되었다고 볼 수 있을 것 같아요.

    ReviewConverter에 동일한 메서드 추가하거나 Converter 자체가 페이징과 관련되어 있다면 global하게 쓰일 것 같으니 page관련 패키지를 따로 두는것도 좋아보입니다.

  4. 검증 Annotation은 모두 잘 적용된 것 같고 GeneralExceptionAdvice에서 또한 잘 잡아주고 있는 것 같습니다.

  5. src/main/java/umc/domain/mission/service/MissionQueryService.java

    if(!cursor.equals("-1")) {
    			String[] cursorSplit = cursor.split(":");
    			switch(query.toLowerCase()) {
    				case "id":
    					Long prevCursor = Long.parseLong(cursorSplit[0]);
    					idCursor = Long.parseLong(cursorSplit[1]);
    
    					missionList = missionRepository.findMissionsByStore_IdAndIdLessThanOrderByIdDesc(
    						storeId,
    						idCursor,
    						pageRequest
    					);
    					break;
    			default:
    				throw new MissionException(MissionErrorCode.MISSION_NOT_FOUND);
    			}
    
    		}
    		
    
    		missionList = missionRepository.findMissionsByStore_IdOrderByIdDesc(storeId, pageRequest);

    구조상 if문을 타는 경우에 missionList에 들어가는 값과, 타지 않을 때 missionList에 들어가는 값이 달라보여요. 할당되는 함수부터가 다르니까요.

    그런데 실제로는 if else 구조가 아니라 if문에서 missionList 에 값을 할당해도 무조건 아래에서 missionList = missionRepository.findMissionsByStore_IdOrderByIdDesc(storeId, pageRequest); 가 수행되는 구조같습니다. 확인 부탁드려용.

    (제가 깃허브에서 직접 보느라 들여쓰기 착각했을수도 있을 것 같아요..)


주니 7주차 수고하셨습니다. 스웨거 캡쳐 미션은 진행하시게 되면 노션 미션기록이나 10thSpring 키워드 업로드시 mission.md에 첨부해주세요~

@LeeJaeJun1
Copy link
Copy Markdown
Author

@YoungJJun
@min 사용해서 page 값에 대해 예외값 처리햇습니다!
앞으로 페이징 관련 API가 많이 발생할 것 같아서 global에 DTO 파일 추가해서 CursorResponseDTO와 PageResponseDTO 코드 추가해서 처리했습니다
if문 처리는 제가 실수한게 맞아서.. if문에 else 추가했습니다!!
스웨거 캡처는 mission에 추가했습니다

바쁠실텐데 완죤 빠른 코드리뷰 감사드립니다앙⭐️

@YoungJJun
Copy link
Copy Markdown
Collaborator

페이징 관련 ResponseDTO 추가 좋네요!!
팀원들한테도 공유, 설명 해주시면 좋을 것 같습니다.


// 마이페이지
@GetMapping("/{memberId}/mypage")
@Operation(summary = "마이페이지 조회")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

스웨거 설명 다신 것 좋은거 같습니다!

public ApiResponse<CursorResponseDTO<ReviewResDTO.ReviewPreviewDTO>> getMyReviews(
@PathVariable(name = "memberId") Long memberId,
@RequestParam(name = "cursor", defaultValue = "-1") String cursor,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

디폴트 값 설정하신게 좋은거 같습니다!

public static class ReviewCreateDTO {
@NotBlank(message = "리뷰 내용은 필수 입력 항목입니다.")
String reviewContent;
@NotNull(message = "별점은 필수 입력 항목입니다.") @Min(value = 1) @Max(5)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@min 이랑 @max 에도 에러 message 따로 설정하시면 좋을 것 같습니다!

this.hasNext = slice.hasNext();
}

/**
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

글로벌 DTO로 페이징 일반화하신게 너무 좋은 것 같습니당!

@LeeJaeJun1 LeeJaeJun1 merged commit 6352c5e into UMC-Inha:junny/main May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chapter07_API 설계 심화 - 페이징

3 participants