shinnosuke
2026-09-10 65b57875700bf42ebd17eafa01a265e5690ce271
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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<Map<String, Object>> statistics(@RequestParam(required = false, defaultValue = "month") String period) {
        return ApiResponse.success(service.summary(period));
    }
}