From 121e4a6aa965028b1047798af68ffe719755bfce Mon Sep 17 00:00:00 2001 From: xxoznge <20201049@sungshin.ac.kr> Date: Tue, 15 Oct 2024 23:56:43 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20RequestPart=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/card/controller/CardController.java | 4 ++-- .../domain/user/controller/UserController.java | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ddabong/ddabongdotchiBE/domain/card/controller/CardController.java b/src/main/java/com/ddabong/ddabongdotchiBE/domain/card/controller/CardController.java index e37ae6a..c5b3b75 100644 --- a/src/main/java/com/ddabong/ddabongdotchiBE/domain/card/controller/CardController.java +++ b/src/main/java/com/ddabong/ddabongdotchiBE/domain/card/controller/CardController.java @@ -7,9 +7,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import com.ddabong.ddabongdotchiBE.domain.card.dto.request.CardCreateRequest; @@ -41,7 +41,7 @@ public class CardController { @PostMapping(value = "") public ApiResponse createCard( @UserResolver User authUser, - @RequestPart(value = "request") @Valid CardCreateRequest request + @RequestBody @Valid CardCreateRequest request ) { return ApiResponse.onSuccess(cardService.createCard(authUser, request)); } diff --git a/src/main/java/com/ddabong/ddabongdotchiBE/domain/user/controller/UserController.java b/src/main/java/com/ddabong/ddabongdotchiBE/domain/user/controller/UserController.java index 993d650..915b7aa 100644 --- a/src/main/java/com/ddabong/ddabongdotchiBE/domain/user/controller/UserController.java +++ b/src/main/java/com/ddabong/ddabongdotchiBE/domain/user/controller/UserController.java @@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import com.ddabong.ddabongdotchiBE.domain.global.ApiResponse; @@ -44,7 +43,7 @@ public class UserController { @PostMapping(value = "/join") public ApiResponse join( - @RequestPart(value = "request") @Valid UserJoinRequest request + @RequestBody @Valid UserJoinRequest request ) { return ApiResponse.onSuccess(userService.join(request)); } @@ -83,10 +82,10 @@ public ApiResponse> getMyCards(@UserResolver User user) return ApiResponse.onSuccess(UserQueryService.getMyCard(user)); } - @PatchMapping(value = "/me") + @PatchMapping("/me") public ApiResponse updateMyUser( @UserResolver User user, - @RequestPart @Valid UserUpdateRequest request) { + @RequestBody @Valid UserUpdateRequest request) { return ApiResponse.onSuccess(userService.updateMyUser(user, request)); }