-
Notifications
You must be signed in to change notification settings - Fork 1
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
[feat] 컨트롤러 API 공통 응답 처리 #50
The head ref may contain hidden characters: "feature/32_june-777_\uCEE8\uD2B8\uB864\uB7ECAPI\uACF5\uD1B5\uC751\uB2F5"
Conversation
supports 메서드가 true 일때만, 해당 Advice가 동작 1. 컨버터 타입이 MappingJackson2HttpMessageConverter 이 2. 파라미터타입이 ResponseEntity가 아니고 3. 파라미터타입이 ProblemDetail가 아닐때
- HttpStatus를 가져오는 기능 - body 가 null이면 No content 를 body로 갖는 APIResponse 응답 - body 가 이미 APIResponse이면 바로 응답 - HttpStatus와 body로 APIResponse 객체를 응답
- APIResponseAdvice 가 APIResponse 객체를 생성해서 반환해야 함
- 컨트롤러는 responseDTO를 반환 - 응답 공통 처리는 Advice에서 수행 - @ResponseStatus 로 상태 코드 명시
- 컨트롤러는 responseDTO를 반환 - 응답 공통 처리는 Advice에서 수행 - @ResponseStatus 로 상태 코드 명시
- 컨트롤러는 responseDTO를 반환 - 응답 공통 처리는 Advice에서 수행 - @ResponseStatus 로 상태 코드 명시
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.
APIUtils에 @Deprecated
붙이면 좋겠습니다!
8540ad5 반영 완료했습니다! |
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.
LGTM 🚀
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.
좋습니다!
💡 다음 이슈를 해결했어요.
Issue Link - #32
APIResponseAdvice
에서 컨트롤러의 responseDTO 를 APIResponse 로 응답하도록 공통 로직을 처리supports 메서드에서 해당 어드바이스가 처리해도 되는지 확인
MappingJackson2HttpMessageConverter
컨버터가 아니면 무시beforeBodyWrite 에서 공통 로직을 수행
🔔 notice:
💡 이슈를 처리하면서 추가된 코드가 있어요.
기존 API 컨트롤러의 반환 타입 변경 및 @httpstatus 명시
[refactor] 구매자 회원가입 컨트롤러 반환타입 변경
[refactor] 계좌 충전 컨트롤러 반환타입 변경
[refactor] 점주 회원가입 컨트롤러 반환타입 변경
✅ 셀프 체크리스트