Skip to content

[FEAT] 6주차 미션_오아시스#22

Open
wnsgh7368 wants to merge 1 commit intooasisfrom
week6-oasis
Open

[FEAT] 6주차 미션_오아시스#22
wnsgh7368 wants to merge 1 commit intooasisfrom
week6-oasis

Conversation

@wnsgh7368
Copy link
Copy Markdown

@wnsgh7368 wnsgh7368 commented May 5, 2026

🛠️️ 작업 사항

01 Swagger ApiSpecification 인터페이스 분리

  • 도메인 패키지 내 api 패키지를 생성하고 ~~ApiSpecification 인터페이스로 Swagger 명세를 분리
  • Controller에서 해당 인터페이스를 implements하여 비즈니스 로직과 API 문서 명세를 분리
  • HomeApiSpecification, MemberApiSpecification, ReviewApiSpecification, MissionApiSpecification 구현

02 API Controller, Service, Converter, Repository 구현

  • 회원가입 API 컨트롤러 및 DTO 구현 (POST /api/auth/signup)
  • 홈 화면 조회 API 구현 (GET /api/users/{userId}/home?regionId=&page=&size=)
    • 현재 선택된 지역의 미션 목록 페이징 조회, 포인트, 미션 진행도 반환
  • 마이페이지 조회 API 구현 (GET /api/users/{userId}/mypage)
    • 닉네임, 이메일, 휴대폰번호, 인증여부, 포인트 반환
  • 리뷰 생성 API 구현 (POST /api/stores/{storeId}/reviews)
    • Review, ReviewImage 엔티티 저장, ReviewConverter를 통한 변환
  • 미션 목록 조회 API 구현 (GET /api/users/{userId}/missions?status=progress&page=&size=)
    • 진행중/진행완료 상태별 페이징 조회
  • 미션 완료 API 구현 (PATCH /api/users/{userId}/missions/{missionId}/complete)
    • MemberMission 상태 변경 및 완료일 설정

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

image

💬 기타 설명

@wnsgh7368 wnsgh7368 requested a review from Cheesebee May 5, 2026 08:02
@wnsgh7368 wnsgh7368 self-assigned this May 5, 2026
Copy link
Copy Markdown
Contributor

@Cheesebee Cheesebee 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 +26 to +28
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
private Member member;
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랑 매핑되어 있는데 컬럼명이 user_id라서 살짝 헷갈릴 수도 있을 것 같아!
member_id로 통일하면 다른 엔티티들이랑도 일관성 맞을 듯

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

오 피드백 고마워! 이 부분 왜 이렇게 했지,,

Comment on lines +37 to +38
@Column(name = "content", nullable = false, length = 255)
private String content;
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.

문의 내용이면 생각보다 길어질 수도 있어서 length 255는 조금 부족할 수도 있을 것 같아
TEXT 타입으로 빼도 괜찮을듯?

Comment on lines +43 to +49
@OneToMany(mappedBy = "inquiry", cascade = CascadeType.ALL)
@Builder.Default
private List<InquiryImage> inquiryImageList = new ArrayList<>();

@OneToMany(mappedBy = "inquiry", cascade = CascadeType.ALL)
@Builder.Default
private List<InquiryAnswer> inquiryAnswerList = new ArrayList<>();
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.

연관관계 컬렉션들 Builder.Default로 초기화해둔 거 좋은 것 같아!
builder 사용할 때 리스트 null 되는 상황 방지할 수 있어서 안정적으로 보였음

Comment on lines +17 to +21
@Operation(summary = "홈 조회", description = "현재 선택된 지역에서 도전 가능한 미션 목록을 페이징하여 조회합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "홈 조회 성공"),
@ApiResponse(responseCode = "404", description = "회원을 찾을 수 없음")
})
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.

이것이 API 관점..?
Swagger 명세를 인터페이스로 따로 분리한 거 좋다...
Controller 쪽이 훨씬 깔끔해지네!!

Comment on lines +39 to +43
HomeResDTO.MissionProgressDTO missionProgress = HomeResDTO.MissionProgressDTO.builder()
.current((int) completedCount)
.total(10)
.rewardPoint(1000)
.build();
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.

여기 total이랑 rewardPoint는 현재 하드코딩인데, 나중에 당연히 바꾸겠지??
상수나 별도 로직으로 분리해도 괜찮을 듯

return HomeResDTO.MissionDTO.builder()
.missionId(mission.getId())
.storeName(mission.getStore().getStoreName())
.category(mission.getStore().getFoodCategory().getCategoryName())
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.

연관 객체 계속 타고 들어가서 조회하는 구조라 N+1 문제 생길 가능성도 있을 것 같아!
fetch join같은 걸 고려해봐도 괜찮을듯??

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

오오,, 그러게 다시 생각해봐야겠다

Comment on lines 38 to 40
return ResponseEntity
.status(MemberSuccessCode.MEMBER_MYPAGE_SUCCESS.getStatus())
.body(ApiResponse.onSuccess(MemberSuccessCode.MEMBER_MYPAGE_SUCCESS, response));
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.

SuccessCode 따로 분리해서 사용하는 방식 좋은 것 같아
응답 형식 일관성 맞추기 편해 보였음

Comment on lines +16 to +20
@Operation(summary = "내 미션 목록 조회", description = "진행중/진행완료 상태별 미션 목록을 페이징하여 조회합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "미션 목록 조회 성공"),
@ApiResponse(responseCode = "404", description = "회원을 찾을 수 없음")
})
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.

오아시스 진짜 친절은 GOAT다..

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