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.ScreenProjectListItemVo;
import com.ruoyi.web.modules.screen.service.ICommonProsperityScreenService;

/**
 * 大屏 — 共同富裕统计（只读）
 */
@RestController
@RequestMapping("/bigScreen/commonProsperity")
public class CommonProsperityScreenController extends BaseController
{
    @Autowired
    private ICommonProsperityScreenService commonProsperityScreenService;

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

    @GetMapping("/projects")
    public TableDataInfo projects(@RequestParam("statYear") String statYear)
    {
        startPage();
        List<ScreenProjectListItemVo> list = commonProsperityScreenService.listPublishedProjects(statYear);
        return getDataTable(list);
    }
}
