Conversation
Cheesebee
left a comment
There was a problem hiding this comment.
많이 배웠어정말... 내가 갈길이 아주멀구나....
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "user_id", nullable = false) | ||
| private Member member; |
There was a problem hiding this comment.
member랑 매핑되어 있는데 컬럼명이 user_id라서 살짝 헷갈릴 수도 있을 것 같아!
member_id로 통일하면 다른 엔티티들이랑도 일관성 맞을 듯
| @Column(name = "content", nullable = false, length = 255) | ||
| private String content; |
There was a problem hiding this comment.
문의 내용이면 생각보다 길어질 수도 있어서 length 255는 조금 부족할 수도 있을 것 같아
TEXT 타입으로 빼도 괜찮을듯?
| @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<>(); |
There was a problem hiding this comment.
연관관계 컬렉션들 Builder.Default로 초기화해둔 거 좋은 것 같아!
builder 사용할 때 리스트 null 되는 상황 방지할 수 있어서 안정적으로 보였음
| @Operation(summary = "홈 조회", description = "현재 선택된 지역에서 도전 가능한 미션 목록을 페이징하여 조회합니다.") | ||
| @ApiResponses(value = { | ||
| @ApiResponse(responseCode = "200", description = "홈 조회 성공"), | ||
| @ApiResponse(responseCode = "404", description = "회원을 찾을 수 없음") | ||
| }) |
There was a problem hiding this comment.
이것이 API 관점..?
Swagger 명세를 인터페이스로 따로 분리한 거 좋다...
Controller 쪽이 훨씬 깔끔해지네!!
| HomeResDTO.MissionProgressDTO missionProgress = HomeResDTO.MissionProgressDTO.builder() | ||
| .current((int) completedCount) | ||
| .total(10) | ||
| .rewardPoint(1000) | ||
| .build(); |
There was a problem hiding this comment.
여기 total이랑 rewardPoint는 현재 하드코딩인데, 나중에 당연히 바꾸겠지??
상수나 별도 로직으로 분리해도 괜찮을 듯
| return HomeResDTO.MissionDTO.builder() | ||
| .missionId(mission.getId()) | ||
| .storeName(mission.getStore().getStoreName()) | ||
| .category(mission.getStore().getFoodCategory().getCategoryName()) |
There was a problem hiding this comment.
연관 객체 계속 타고 들어가서 조회하는 구조라 N+1 문제 생길 가능성도 있을 것 같아!
fetch join같은 걸 고려해봐도 괜찮을듯??
| return ResponseEntity | ||
| .status(MemberSuccessCode.MEMBER_MYPAGE_SUCCESS.getStatus()) | ||
| .body(ApiResponse.onSuccess(MemberSuccessCode.MEMBER_MYPAGE_SUCCESS, response)); |
There was a problem hiding this comment.
SuccessCode 따로 분리해서 사용하는 방식 좋은 것 같아
응답 형식 일관성 맞추기 편해 보였음
| @Operation(summary = "내 미션 목록 조회", description = "진행중/진행완료 상태별 미션 목록을 페이징하여 조회합니다.") | ||
| @ApiResponses(value = { | ||
| @ApiResponse(responseCode = "200", description = "미션 목록 조회 성공"), | ||
| @ApiResponse(responseCode = "404", description = "회원을 찾을 수 없음") | ||
| }) |
🛠️️ 작업 사항
01 Swagger ApiSpecification 인터페이스 분리
02 API Controller, Service, Converter, Repository 구현
📸 관련 이미지 (스크린샷 또는 동영상)
💬 기타 설명