We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
{ "success": true, "code": 0, "message": "Ok", "data": [ 1, 2, 3 ] }
The text was updated successfully, but these errors were encountered:
public record ApiResponse<T>(Boolean isSuccess, int code, String message, @JsonProperty(value = "response") T response, @JsonProperty(value = "errorResponse") ErrorResponse errorResponse) { }
호출 예시
return new ApiResponse(true,200,"success", posting, null);
Sorry, something went wrong.
message에는 구체적으로 어떤 정보가 들어가나요? 단순 성공, 실패 여부면 message와 isSuccess를 나눈 이유가 있을까요?
message에는 해당 API 통신 결과를 대표할 수 있는 의도로 만들었습니다. 예를들어 error일 경우 message에서 해당 error type를 넣고 구체적인 내용은 errorReponse에 넣게 됩니다. isSuccess와 의미가 중복되는 것 같긴 하네요
No branches or pull requests
ex)
{ "success": true, "code": 0, "message": "Ok", "data": [ 1, 2, 3 ] }
The text was updated successfully, but these errors were encountered: