| | |
| | | package com.rongyichuang.dashboard.api; |
| | | |
| | | import com.rongyichuang.dashboard.dto.response.DashboardStatsResponse; |
| | | import com.rongyichuang.dashboard.dto.response.RegionRegistrationStat; |
| | | import com.rongyichuang.dashboard.dto.response.RegistrationTrendPoint; |
| | | import com.rongyichuang.dashboard.service.DashboardService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.graphql.data.method.annotation.Argument; |
| | | import org.springframework.graphql.data.method.annotation.QueryMapping; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Dashboard GraphQL API |
| | |
| | | log.info("获取Dashboard统计数据"); |
| | | return dashboardService.getDashboardStats(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取报名趋势数据 |
| | | */ |
| | | @QueryMapping |
| | | public List<RegistrationTrendPoint> registrationTrend(@Argument Integer days) { |
| | | log.info("获取报名趋势,天数: {}", days); |
| | | return dashboardService.getRegistrationTrend(days); |
| | | } |
| | | |
| | | /** |
| | | * 获取区域报名分布 |
| | | */ |
| | | @QueryMapping |
| | | public List<RegionRegistrationStat> registrationRegionStats() { |
| | | log.info("获取区域报名分布"); |
| | | return dashboardService.getRegionRegistrationStats(); |
| | | } |
| | | } |