66import clap .server .application .port .inbound .statistics .*;
77import clap .server .common .annotation .architecture .WebAdapter ;
88import clap .server .exception .StatisticsException ;
9+ import io .swagger .v3 .oas .annotations .Operation ;
10+ import io .swagger .v3 .oas .annotations .Parameter ;
911import io .swagger .v3 .oas .annotations .tags .Tag ;
1012import lombok .RequiredArgsConstructor ;
1113import org .springframework .http .ResponseEntity ;
@@ -28,6 +30,9 @@ public class FindStatisticsController {
2830 private final FindSubCategoryTaskRequestUsecase findSubCategoryTaskRequestUsecase ;
2931 private final FindManagerTaskProcessUsecase findManagerTaskProcessUsecase ;
3032
33+ @ Operation (summary = "기본 통계 API" )
34+ @ Parameter (name = "periodType" , description = "day, week, month" , required = true )
35+ @ Parameter (name = "statisticsType" , description = "request-by-period, process-by-period, request-by-category, process-by-manager" , required = true )
3136 @ GetMapping
3237 public ResponseEntity <List <StatisticsResponse >> aggregateTaskStatistics (@ RequestParam PeriodType periodType , @ RequestParam StatisticsType statisticsType ) {
3338 switch (statisticsType ) {
@@ -62,10 +67,13 @@ public ResponseEntity<List<StatisticsResponse>> aggregateTaskStatistics(@Request
6267 throw new StatisticsException (STATISTICS_BAD_REQUEST );
6368 }
6469
70+ @ Operation (summary = "1차 카테고리 하위 2차 카테고리별 통계 API" )
71+ @ Parameter (name = "periodType" , description = "day, week, month" , required = true )
72+ @ Parameter (name = "mainCategory" , description = "1차 카테고리 이름" , required = true )
6573 @ GetMapping ("/subcategory" )
66- public ResponseEntity <List <StatisticsResponse >> aggregateSubCategoryTaskRequest (@ RequestParam String period , @ RequestParam String mainCategory ) {
74+ public ResponseEntity <List <StatisticsResponse >> aggregateSubCategoryTaskRequest (@ RequestParam PeriodType periodType , @ RequestParam String mainCategory ) {
6775 return ResponseEntity .ok (findSubCategoryTaskRequestUsecase
68- .aggregateSubCategoryTaskRequest (period , mainCategory )
76+ .aggregateSubCategoryTaskRequest (periodType . getType () , mainCategory )
6977 .entrySet ()
7078 .stream ()
7179 .map (result -> new StatisticsResponse (result .getKey (), result .getValue ()))
0 commit comments