From 0c326660c0d142d1cdba9acdb29d227924fa0c14 Mon Sep 17 00:00:00 2001 From: MJJ Date: Sun, 18 Aug 2024 00:33:26 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20consumptionGoal=20Controller=20?= =?UTF-8?q?=EC=97=94=EB=93=9C=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ConsumptionGoalController.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/bbteam/budgetbuddies/domain/consumptiongoal/controller/ConsumptionGoalController.java b/src/main/java/com/bbteam/budgetbuddies/domain/consumptiongoal/controller/ConsumptionGoalController.java index 0233a4c6..d14dce3e 100644 --- a/src/main/java/com/bbteam/budgetbuddies/domain/consumptiongoal/controller/ConsumptionGoalController.java +++ b/src/main/java/com/bbteam/budgetbuddies/domain/consumptiongoal/controller/ConsumptionGoalController.java @@ -27,13 +27,13 @@ @RestController @RequiredArgsConstructor -@RequestMapping("/consumption-goal") +@RequestMapping("/consumption-goals") public class ConsumptionGoalController implements ConsumptionGoalApi { private final ConsumptionGoalService consumptionGoalService; @Override - @GetMapping("/top-categories/top-goal/4") + @GetMapping("/categories/top-goals/top-4") public ApiResponse> getTopConsumptionGoalCategories( @RequestParam(name = "userId") Long userId, @RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart, @@ -44,7 +44,7 @@ public ApiResponse> getTopConsumptionGoalCatego return ApiResponse.onSuccess(response); } - @GetMapping("/top-categories/top-goal") + @GetMapping("/categories/top-goals") public ApiResponse> getAllConsumptionGoalCategories( @RequestParam(name = "userId") Long userId, @RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart, @@ -84,7 +84,7 @@ public ResponseEntity updateOrElseGenerateConsum .body(consumptionGoalService.updateConsumptionGoals(userId, consumptionGoalListRequestDto)); } - @GetMapping("/top-categories/top-consumption/3") + @GetMapping("/categories/top-consumptions/top-3") public ApiResponse> getTopConsumptionCategories( @RequestParam(name = "userId") Long userId, @RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart, @@ -95,7 +95,7 @@ public ApiResponse> getTopConsumptionCategories( return ApiResponse.onSuccess(response); } - @GetMapping("/top-categories/top-consumption") + @GetMapping("/categories/top-consumptions") public ApiResponse> getAllConsumptionCategories( @RequestParam(name = "userId") Long userId, @RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart, @@ -106,8 +106,9 @@ public ApiResponse> getAllConsumptionCat return ApiResponse.onSuccess(response); } - @GetMapping("/top-categories/top-consumption/{userId}") - public ApiResponse getTopCategoryAndConsumptionAmount(@PathVariable Long userId) { + @GetMapping("/category/top-goals") + public ApiResponse getTopCategoryAndConsumptionAmount( + @RequestParam(name = "userId") Long userId) { ConsumptionAnalysisResponseDto response = consumptionGoalService.getTopCategoryAndConsumptionAmount(userId); return ApiResponse.onSuccess(response); }