shinnosuke
2026-08-06 f12cbba923cebd30416d170eff2b116f4f013a29
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
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.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() {
        return ApiResponse.success(service.summary());
    }
}