package com.ruoyi.web.modules.screen.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.web.modules.screen.domain.vo.HomeScreenStandardListItemVo;
import com.ruoyi.web.modules.screen.service.IHomeScreenService;

/**
 * 大屏 — 首页统计（只读）
 */
@RestController
@RequestMapping("/bigScreen/home")
public class HomeScreenController extends BaseController
{
    @Autowired
    private IHomeScreenService homeScreenService;

    @GetMapping("/dashboard")
    public AjaxResult dashboard(@RequestParam("statYear") String statYear)
    {
        return success(homeScreenService.loadDashboard(statYear));
    }

    @GetMapping("/standards")
    public TableDataInfo standards(
            @RequestParam("statYear") String statYear,
            @RequestParam("category") String category)
    {
        startPage();
        List<HomeScreenStandardListItemVo> list = homeScreenService.listStandards(statYear, category);
        return getDataTable(list);
    }
}
