package com.talentcard.server.business.admin; import com.talentcard.server.common.ApiResponse; import com.talentcard.server.service.AdminWorkbenchStatisticsService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Map; @RestController @RequestMapping("/api/admin/workbench") @Tag(name = "后台工作台", description = "后台首页核心指标、图表和异常告警") public class AdminWorkbenchStatisticsController { private final AdminWorkbenchStatisticsService service; public AdminWorkbenchStatisticsController(AdminWorkbenchStatisticsService service) { this.service = service; } @GetMapping({"/statistics", "/dashboard"}) @Operation(summary = "查询工作台统计", description = "返回累计补贴总额、本月核销单数、持卡人总数、核销趋势、待处理、热销商家和订单类别占比") public ApiResponse> statistics(@RequestParam(required = false, defaultValue = "month") String period) { return ApiResponse.success(service.summary(period)); } }