package com.tourguide.api.admin; import com.tourguide.common.api.ApiResponse; import com.tourguide.modules.dashboard.dto.DashboardResponse; import com.tourguide.modules.dashboard.service.DashboardService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * 管理后台首页工作台数据接口。 * 聚合用户、订单、评价、收益趋势、热门景区和订单类别占比,减少首页多次请求。 */ @RestController @RequestMapping("/api/admin/dashboard") public class AdminDashboardController { private final DashboardService dashboardService; public AdminDashboardController(DashboardService dashboardService) { this.dashboardService = dashboardService; } /** * 获取工作台当前统计概览及图表数据。 * * @return 首页指标卡、近七日收益、热门景区和订单类别统计 */ @GetMapping public ApiResponse overview() { return ApiResponse.success(dashboardService.overview()); } }