-
Notifications
You must be signed in to change notification settings - Fork 0
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
[10] 상품 등록 #17
[10] 상품 등록 #17
Conversation
- 상품 등록을 위한 카테고리 조회 - 상품 등록
develop을 기본 브랜치로 바꿔주시고, feature 브랜치가 develop에 머지가 안됐으면, feature 브랜치에서 새로운 feature 브랜치를 따서 작업해주세요~~ |
공통적인 API 응답 포맷과 에러 응답 객체를 만들어주세요 |
6-create-user-and-partner 를 머지해버려서..... 담부터는
이렇게 가라는 말씀이신가요????? |
네 맞습니다 |
|
||
public static <T> CommonResponse.CommonData<T> success(T data) { | ||
return (CommonResponse.CommonData<T>) CommonData.builder() | ||
.message(MESSAGE_SUCCESS) |
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.
성공시 message는 안내보내도 되긴 해요
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class CommonData<T> { |
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.
성공 응답인 경우만 CommonData 쓰는 걸로 보이는데 code랑 message는 필요 없어요
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.
이렇게 중첩클래스로 정의하면 API response return 타입 명시할 때 마다 CommonResponse.CommonData 이렇게 써야하니, 길어지는 단점이 있는데
중첩 클래스를 안쓰는게 더 편하지 않을까요??
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.
ApiFailResponse, ApiSuccessResponse 로 분리했습니다
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class CommonResponse { |
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.
Common이란 네이밍보단 ApiResponse 이렇게 명시하는게 더 정확하지 않을까요??
- 성공시 불필요한 code, message 제거
No description provided.