package com.haisen.laop.controller; import com.haisen.laop.common.Result; import com.haisen.laop.service.DashboardService; import com.haisen.laop.vo.DashboardVO; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * 数据驾驶舱 —— Web 后台首页统计聚合 Controller。 * *

消费端:Web 管理后台 Dashboard 首页。 *

路径前缀:{@code /dashboard/*},单接口聚合返回全部统计数据,避免多接口瀑布加载。 *

职责:Controller 层只做路由与 Result 包装,业务逻辑全部委托 {@link DashboardService}。

* * @author duhao */ @RestController @RequestMapping("/dashboard") @RequiredArgsConstructor public class DashboardController { private final DashboardService dashboardService; /** * 获取数据驾驶舱全量统计数据。 * *

一次性返回用户/商家/飞手总量、任务总量与状态分布、近 6 个月月度增长趋势、 * 任务类型分布等所有 Dashboard 图表所需数据。

* * @return Dashboard 聚合 VO */ @GetMapping("/stats") public Result getStats() { return Result.success(dashboardService.getDashboardStats()); } }