package com.rongyichuang.dashboard.api;
|
|
import com.rongyichuang.dashboard.dto.response.DashboardStatsResponse;
|
import com.rongyichuang.dashboard.service.DashboardService;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.graphql.data.method.annotation.QueryMapping;
|
import org.springframework.stereotype.Controller;
|
|
/**
|
* Dashboard GraphQL API
|
*/
|
@Controller
|
public class DashboardGraphqlApi {
|
|
private static final Logger log = LoggerFactory.getLogger(DashboardGraphqlApi.class);
|
|
private final DashboardService dashboardService;
|
|
public DashboardGraphqlApi(DashboardService dashboardService) {
|
this.dashboardService = dashboardService;
|
}
|
|
/**
|
* 获取Dashboard统计数据
|
*/
|
@QueryMapping
|
public DashboardStatsResponse dashboardStats() {
|
log.info("获取Dashboard统计数据");
|
return dashboardService.getDashboardStats();
|
}
|
}
|