-
Notifications
You must be signed in to change notification settings - Fork 0
Feat : Chapter 8. API & Swagger & Annotation #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ggamnunq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
| import com.example.umc9th.global.apiPayload.exception.GeneralException; | ||
|
|
||
| public class FoodException extends GeneralException { | ||
| public FoodException(BaseErrorCode code) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
꼭 도메인별로 나눌 필요 없다는 점 remind!
| @RequestParam(required = false) String query | ||
| ) { | ||
| List<Review> list = reviewQueryService.searchMyReviews(memberId, type, query); | ||
| ReviewResDTO.MyReviews dto = ReviewConverter.toMyReviews(list); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dto 변환은 Controller의 역할이 아니에요
| @GetMapping("/reviews/me") | ||
| public ApiResponse<ReviewResDTO.MyReviews> myReviews( | ||
| @RequestParam Long memberId, | ||
| @RequestParam(required = false) String type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
필수값이 아닐 때는 이후 비즈니스 로직에서 null에 대한 처리를 잘 해주세요!
| @RequiredArgsConstructor | ||
| public class FoodExistValidator implements ConstraintValidator<ExistFoods, List<Long>> { | ||
|
|
||
| private final FoodRepository foodRepository; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository 코드에 접근하는건 웬만하면 service 코드에서만 해주세요
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
|
|
||
| @Configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 스터디에서 말씀드리긴 했는데,
@EnableJpaAuditing 이 어노테이션은 SpringBootApplication.java에 붙여줘도 됩니당
No description provided.