Skip to content

Commit 680428a

Browse files
committed
CLAP-111 refactor : 통계 컨트롤러 스웨거 수정 및 2차 카테고리별 통계 수정
<footer> - 관련: #74
1 parent 24c582d commit 680428a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/java/clap/server/adapter/inbound/web/statistics/FindStatisticsController.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import clap.server.application.port.inbound.statistics.*;
77
import clap.server.common.annotation.architecture.WebAdapter;
88
import clap.server.exception.StatisticsException;
9+
import io.swagger.v3.oas.annotations.Operation;
10+
import io.swagger.v3.oas.annotations.Parameter;
911
import io.swagger.v3.oas.annotations.tags.Tag;
1012
import lombok.RequiredArgsConstructor;
1113
import 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

Comments
 (0)