From e160f5a0df005c167fdc3fd78f6ba6c8fec5bc3a Mon Sep 17 00:00:00 2001 From: Nine-JH Date: Tue, 16 Jan 2024 02:29:19 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[bugfix]=20ApiResponse=EC=97=90=20=EC=A0=9C?= =?UTF-8?q?=EB=84=A4=EB=A6=AD=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C?= =?UTF-8?q?=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit motivation: - 정적팩토리 메서드의 리턴타입에 제네릭이 누락되어 문제가 raw type warning이 발생하였습니다. 제네릭을 추가함으로써 간단하게 해결을 할 수 있습니다. modification: - 정적팩토리 메서드에 제네릭 추가 Close #103 --- .../java/fc/be/app/global/http/ApiResponse.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/fc/be/app/global/http/ApiResponse.java b/app/src/main/java/fc/be/app/global/http/ApiResponse.java index c213111c..95fa6e48 100644 --- a/app/src/main/java/fc/be/app/global/http/ApiResponse.java +++ b/app/src/main/java/fc/be/app/global/http/ApiResponse.java @@ -11,19 +11,19 @@ public record ApiResponse( private static final HttpStatus CREATED = HttpStatus.CREATED; private static final String DEFAULT_MESSAGE = "SUCCESS"; - public static ApiResponse ok() { - return new ApiResponse(OK.value(), DEFAULT_MESSAGE, null); + public static ApiResponse ok() { + return new ApiResponse<>(OK.value(), DEFAULT_MESSAGE, null); } - public static ApiResponse ok(T data) { - return new ApiResponse(OK.value(), DEFAULT_MESSAGE, data); + public static ApiResponse ok(T data) { + return new ApiResponse<>(OK.value(), DEFAULT_MESSAGE, data); } - public static ApiResponse created() { - return new ApiResponse(CREATED.value(), DEFAULT_MESSAGE, null); + public static ApiResponse created() { + return new ApiResponse<>(CREATED.value(), DEFAULT_MESSAGE, null); } - public static ApiResponse created(T data) { - return new ApiResponse(CREATED.value(), DEFAULT_MESSAGE, data); + public static ApiResponse created(T data) { + return new ApiResponse<>(CREATED.value(), DEFAULT_MESSAGE, data); } } From 1f7fee1442de4bbaee4a1094cf5f7051b8b21e20 Mon Sep 17 00:00:00 2001 From: Nine-JH Date: Tue, 16 Jan 2024 02:42:42 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[bugfix]=20=EC=BB=B4=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=EB=A5=BC=20=EC=88=98=EC=A0=95=ED=95=9C?= =?UTF-8?q?=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit motivation: - 제네릭 타입을 생성하면서 발생한 컴파일 에러 수정 modification: - ReviewController.java 수정 Close #103 --- .../fc/be/app/domain/review/controller/ReviewController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/fc/be/app/domain/review/controller/ReviewController.java b/app/src/main/java/fc/be/app/domain/review/controller/ReviewController.java index 964abee8..fb7bea32 100644 --- a/app/src/main/java/fc/be/app/domain/review/controller/ReviewController.java +++ b/app/src/main/java/fc/be/app/domain/review/controller/ReviewController.java @@ -22,7 +22,7 @@ public ApiResponse createReview(@Valid @RequestBody Review } @PatchMapping - public ApiResponse editReview(@Valid @RequestBody ReviewEditRequest reviewEditRequest) { + public ApiResponse editReview(@Valid @RequestBody ReviewEditRequest reviewEditRequest) { return ApiResponse.ok(reviewService.editReview(reviewEditRequest)); }