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

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.web.modules.industryservice.service.IBreedingIndustryDashboardService;

/**
 * 养殖产业数据看板
 */
@RestController
@RequestMapping("/dataModel/breedingIndustry")
public class BreedingIndustryDashboardController extends BaseController
{
    @Autowired
    private IBreedingIndustryDashboardService breedingIndustryDashboardService;

    @PreAuthorize("@ss.hasPermi('dataModel:breedingIndustry:query')")
    @GetMapping("/dashboard")
    public AjaxResult dashboard(
            @RequestParam(value = "forceRefresh", defaultValue = "false") boolean forceRefresh,
            @RequestParam(value = "statYear", required = false) String statYear)
    {
        return success(breedingIndustryDashboardService.loadDashboard(forceRefresh, statYear));
    }
}
