liujie
2026-07-30 fc767bf18e262b724c78b5f860b6d908d4993dcb
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
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<DashboardResponse> overview() { return ApiResponse.success(dashboardService.overview()); }
}