Conversation
ApiResponse에서 HTTP Status 상태 표시를 제거합니다.
|
Caution Review failedThe pull request is closed. WalkthroughApiResponse 레코드에서 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10-15 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR removes the HTTP status code field from the common API response structure, simplifying the response format to only include a message and optional data field.
Key Changes:
- Removed the
codefield from theApiResponserecord - Simplified all factory methods (
successanderror) to accept only message and data parameters - Updated all
ImageControllerendpoints to use the new method signatures
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ApiResponse.java | Removed code field from record definition and simplified all factory methods to no longer accept or use HTTP status codes |
| ImageController.java | Updated all seven endpoint response calls to remove the status code parameter from ApiResponse.success() calls |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public static <T> ApiResponse<T> success(String code, String message) { | ||
| return new ApiResponse<>(code, message, null); | ||
| public static <T> ApiResponse<T> success( String message) { | ||
| return new ApiResponse<>( message, null); |
There was a problem hiding this comment.
Extra space after the opening parenthesis. Should be return new ApiResponse<>(message, null); without the extra space.
| return new ApiResponse<>( message, null); | |
| return new ApiResponse<>(message, null); |
|
|
||
| public static <T> ApiResponse<T> success(int code, String message, T data) { | ||
| return new ApiResponse<>(String.valueOf(code), message, data); | ||
| public static <T> ApiResponse<T> error( String message) { |
There was a problem hiding this comment.
Extra space after the opening parenthesis and before the parameter. Should be public static <T> ApiResponse<T> error(String message) without the extra space before String.
|
|
||
| public static <T> ApiResponse<T> success(T data) { | ||
| return new ApiResponse<>("200", "요청이 정상적으로 처리되었습니다.", data); | ||
| return new ApiResponse<>( "요청이 정상적으로 처리되었습니다.", data); |
There was a problem hiding this comment.
Extra space after the opening parenthesis. Should be return new ApiResponse<>("요청이 정상적으로 처리되었습니다.", data); without the extra space.
| return new ApiResponse<>( "요청이 정상적으로 처리되었습니다.", data); | |
| return new ApiResponse<>("요청이 정상적으로 처리되었습니다.", data); |
|
|
||
| public static <T> ApiResponse<T> success(String code, String message) { | ||
| return new ApiResponse<>(code, message, null); | ||
| public static <T> ApiResponse<T> success( String message) { |
There was a problem hiding this comment.
Extra space after the opening parenthesis and before the parameter. Should be public static <T> ApiResponse<T> success(String message) without the extra space before String.
📝 Pull Request
📌 PR 종류
해당하는 항목에 체크해주세요.
✨ 변경 내용
🔍 관련 이슈
🧪 테스트
변경된 기능에 대한 테스트 범위 또는 테스트 결과를 작성해주세요.
🚨 확인해야 할 사항 (Checklist)
PR을 제출하기 전에 아래 항목들을 확인해주세요.
🙋 기타 참고 사항
리뷰어가 참고하면 좋을 만한 추가 설명이 있다면 적어주세요.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.