44
55@ JsonInclude (JsonInclude .Include .NON_NULL )
66public record ApiResponse <T >(
7- String message ,
7+ boolean success ,
88 T data
99) {
1010
1111 public static <T > ApiResponse <T > success (T data ) {
12- return new ApiResponse <>( "요청이 정상적으로 처리되었습니다." , data );
12+ return new ApiResponse <>(Boolean . TRUE , data );
1313 }
1414
15- public static <T > ApiResponse <T > success (String message , T data ) {
16- return new ApiResponse <>(message , data );
15+ public static <T > ApiResponse <T > success (boolean isSuccess , T data ) {
16+ return new ApiResponse <>(isSuccess , data );
1717 }
1818
19- public static <T > ApiResponse <T > success ( String message ) {
20- return new ApiResponse <>( message , null );
19+ public static <T > ApiResponse <T > success (String message ) {
20+ return new ApiResponse <>(Boolean . TRUE , null );
2121 }
2222
23- public static <T > ApiResponse <T > error ( String message ) {
24- return new ApiResponse <>(message , null );
23+ public static <T > ApiResponse <T > error (String message ) {
24+ return new ApiResponse <>(false , null );
2525 }
2626
27- public static <T > ApiResponse <T > error (String message , T data ) {
28- return new ApiResponse <>(message , data );
27+ public static <T > ApiResponse <T > error (boolean isSuccess , T data ) {
28+ return new ApiResponse <>(isSuccess , data );
2929 }
3030}
0 commit comments