Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@

@JsonInclude(JsonInclude.Include.NON_NULL)
public record ApiResponse<T>(
String message,
boolean success,
T data
) {

public static <T> ApiResponse<T> success(T data) {
return new ApiResponse<>( "요청이 정상적으로 처리되었습니다.", data);
return new ApiResponse<>(Boolean.TRUE, data);
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the primitive literal true instead of Boolean.TRUE. Since the field is a primitive boolean, using the boxed Boolean constant unnecessarily creates an object that will be immediately unboxed.

Copilot uses AI. Check for mistakes.
}

public static <T> ApiResponse<T> success(String message, T data) {
return new ApiResponse<>(message, data);
public static <T> ApiResponse<T> success(boolean isSuccess, T data) {
return new ApiResponse<>(isSuccess, data);
}

Comment on lines +15 to 18
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The success() method should not accept a boolean isSuccess parameter. A method named "success" should always set success to true. If you need to dynamically control the success value, consider creating a different factory method or using the constructor directly.

Suggested change
public static <T> ApiResponse<T> success(boolean isSuccess, T data) {
return new ApiResponse<>(isSuccess, data);
}

Copilot uses AI. Check for mistakes.
public static <T> ApiResponse<T> success( String message) {
return new ApiResponse<>( message, null);
public static <T> ApiResponse<T> success(String message) {
return new ApiResponse<>(Boolean.TRUE, null);
Comment on lines +19 to +20
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message parameter is accepted but not used. Since the response format no longer includes a message field (only success and data), this parameter should be removed from the method signature.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the primitive literal true instead of Boolean.TRUE. Since the field is a primitive boolean, using the boxed Boolean constant unnecessarily creates an object that will be immediately unboxed.

Suggested change
return new ApiResponse<>(Boolean.TRUE, null);
return new ApiResponse<>(true, null);

Copilot uses AI. Check for mistakes.
}

public static <T> ApiResponse<T> error( String message) {
return new ApiResponse<>(message, null);
public static <T> ApiResponse<T> error(String message) {
return new ApiResponse<>(false, null);
Comment on lines +23 to +24
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message parameter is accepted but not used. Since the response format no longer includes a message field (only success and data), this parameter should be removed from the method signature.

Copilot uses AI. Check for mistakes.
}

public static <T> ApiResponse<T> error(String message, T data) {
return new ApiResponse<>(message, data);
public static <T> ApiResponse<T> error(boolean isSuccess, T data) {
return new ApiResponse<>(isSuccess, data);
}
Comment on lines +27 to 29
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error() method should not accept a boolean isSuccess parameter. A method named "error" should always set success to false. If you need to dynamically control the success value, consider creating a different factory method or using the constructor directly.

Suggested change
public static <T> ApiResponse<T> error(boolean isSuccess, T data) {
return new ApiResponse<>(isSuccess, data);
}

Copilot uses AI. Check for mistakes.
}
Loading