-
Notifications
You must be signed in to change notification settings - Fork 2
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
[TI-67] 공통 응답용 API 추가 #3
Conversation
public class CommonData { | ||
private final String message; | ||
private final String requestUri; | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMddHHmmss", timezone = "Asia/Seoul") |
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.
@jsonformat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMddHHmmss") 로 하면 timezone utc가 디폴트로 알고있습니다! timezone 정책에 대해서 다 같이 이야기 나눠보면 좋겠습니다!
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.
저도 utc 타임존으로 하는게 어떤가 생각합니다!
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.
timezone을 넣어주나 빼주나 결과값이 같습니다.
나중에 한 번 다시 화인을 해 볼 필요가 있어 보입니다.
|
||
@Getter | ||
public class CommonData { | ||
private final String 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.
필드 사이 개행 넣어주면 좋을 것 같습니다!
public static <T> ApiResponse<T> fail(String failMessage, String requestUri, T data, Integer statusCode) { | ||
CommonData common = new CommonData(failMessage, requestUri, statusCode); | ||
return new ApiResponse<>(common, data); |
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.
statusCode에 Integer 대신에 HttpStatus enum을 사용해 보는건 어떤가요???
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