Skip to content

Commit

Permalink
Merge pull request #134 from BudgetBuddiesTeam/refactor/#133
Browse files Browse the repository at this point in the history
  • Loading branch information
ggamD00 authored Aug 18, 2024
2 parents 14ea1ea + 0c32666 commit 468e99d
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<List<TopGoalCategoryResponseDto>> getTopConsumptionGoalCategories(
@RequestParam(name = "userId") Long userId,
@RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart,
Expand All @@ -44,7 +44,7 @@ public ApiResponse<List<TopGoalCategoryResponseDto>> getTopConsumptionGoalCatego
return ApiResponse.onSuccess(response);
}

@GetMapping("/top-categories/top-goal")
@GetMapping("/categories/top-goals")
public ApiResponse<List<AllConsumptionCategoryResponseDto>> getAllConsumptionGoalCategories(
@RequestParam(name = "userId") Long userId,
@RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart,
Expand Down Expand Up @@ -84,7 +84,7 @@ public ResponseEntity<ConsumptionGoalResponseListDto> updateOrElseGenerateConsum
.body(consumptionGoalService.updateConsumptionGoals(userId, consumptionGoalListRequestDto));
}

@GetMapping("/top-categories/top-consumption/3")
@GetMapping("/categories/top-consumptions/top-3")
public ApiResponse<List<TopCategoryConsumptionDto>> getTopConsumptionCategories(
@RequestParam(name = "userId") Long userId,
@RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart,
Expand All @@ -95,7 +95,7 @@ public ApiResponse<List<TopCategoryConsumptionDto>> getTopConsumptionCategories(
return ApiResponse.onSuccess(response);
}

@GetMapping("/top-categories/top-consumption")
@GetMapping("/categories/top-consumptions")
public ApiResponse<List<AllConsumptionCategoryResponseDto>> getAllConsumptionCategories(
@RequestParam(name = "userId") Long userId,
@RequestParam(name = "peerAgeStart", defaultValue = "0") int peerAgeStart,
Expand All @@ -106,8 +106,9 @@ public ApiResponse<List<AllConsumptionCategoryResponseDto>> getAllConsumptionCat
return ApiResponse.onSuccess(response);
}

@GetMapping("/top-categories/top-consumption/{userId}")
public ApiResponse<ConsumptionAnalysisResponseDto> getTopCategoryAndConsumptionAmount(@PathVariable Long userId) {
@GetMapping("/category/top-goals")
public ApiResponse<ConsumptionAnalysisResponseDto> getTopCategoryAndConsumptionAmount(
@RequestParam(name = "userId") Long userId) {
ConsumptionAnalysisResponseDto response = consumptionGoalService.getTopCategoryAndConsumptionAmount(userId);
return ApiResponse.onSuccess(response);
}
Expand Down

0 comments on commit 468e99d

Please sign in to comment.