Skip to content

Conversation

@infiniment
Copy link
Contributor

No description provided.

@infiniment infiniment merged commit 98c7721 into develop Nov 11, 2025
2 checks passed
@infiniment infiniment changed the title Feat : 3주차에 설계한 URL을 바탕으로 API 구현 Feat : Chapter 8. API & Swagger & Annotation Nov 11, 2025
Copy link

@ggamnunq ggamnunq left a 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) {

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);

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,

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;

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

Choose a reason for hiding this comment

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

이 부분은 스터디에서 말씀드리긴 했는데,
@EnableJpaAuditing 이 어노테이션은 SpringBootApplication.java에 붙여줘도 됩니당

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.

3 participants