5주차 미션 [루크]#5
Conversation
|
상단 루크 폴더로 구조로 만들어 올려뒀습니다 ,,! |
yangjiae12
left a comment
There was a problem hiding this comment.
프로젝트 폴더 구조 문제만 해결하시면 될 것 같아요! 수고하셨습니다~
| @JsonProperty("isSuccess") | ||
| private final boolean isSuccess; |
There was a problem hiding this comment.
boolean을 사용하실 경우 Jackson의 직렬화 과정에서 isSuccess와 success 필드가 중복 생성되기 때문에 Boolean으로 변경하시면 좋을 것 같습니다~
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| import java.lang.reflect.Member; |
There was a problem hiding this comment.
Member 엔티티 임포트 하려다가 잘못 임포트 된 것 같은데 삭제하시면 되겠습니다!
| @RestController | ||
| @RequestMapping("/api") | ||
| @RequiredArgsConstructor | ||
| public class MemberController { | ||
|
|
||
| @PostMapping("/signup") |
There was a problem hiding this comment.
API 경로가 현재는 /api/signup, /api/home/my로 되어 있는데, /api/v1/members/... 형태로 버전을 명시하고 리소스 중심적으로 설계하는 것이 좋습니다.
| public static class SignupDTO { | ||
| public String name; | ||
| public Gender gender; | ||
| public LocalDate birth; | ||
| public String addressLine1; | ||
| public String addressLine2; | ||
| public String email; | ||
| public String phoneNumber; | ||
| public UserType type; | ||
| public Long agreeId; | ||
| } |
There was a problem hiding this comment.
Validation과 Swagger 명세를 추가하면 좋을 것 같습니다!
| public static class CreateReviewDTO { | ||
| public Long marketId; | ||
| public Long regionId; | ||
| public Integer stars; | ||
| public String content; | ||
| } |
There was a problem hiding this comment.
현재 CreateReviewDTO에 모든 ID를 담고 있는데, marketId는 Path Variable로 받고 나머지 리뷰 본문 데이터만 Request Body로 받는 방식이 좋을 것 같습니다! 또한 regionId의 경우 marketId를 통해 서버에서 조회 가능한 정보라면 중복으로 받지 않아도 될 것 같아요.
🚩 관련 이슈
📌 구현 결과
Review, Mission, Member, Home API Controller 및 DTO 구조 구현
API 5개 엔드포인트 생성 + Swagger 연동 및 API 테스트 가능 상태 구성
POST /api/review
GET /api/mission
POST /api/mission/completed
POST /api/signup
GET /api/home/my
ApiResponse 공통 응답 구조 적용
❓ 리뷰 요청
@Entity,@Id를 일괄 적용하여 실행 오류를 해결했는데, 이 방식이 적절한지 궁금합니다.🤔 질문
💬 기타 공유 사항