package com.ruoyi.web.modules.industryservice.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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
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.industryservice.domain.BizGrassLivestockImbalanceWarning;
import com.ruoyi.web.modules.industryservice.service.IBizGrassLivestockImbalanceWarningService;

/**
 * 草畜失衡预警 REST。
 * <p>Base：{@code /dataModel/grassLivestockImbalanceWarning}；权限 {@code dataModel:grassLivestockImbalanceWarning:*}</p>
 */
@RestController
@RequestMapping("/dataModel/grassLivestockImbalanceWarning")
public class BizGrassLivestockImbalanceWarningController extends BaseController
{
    @Autowired
    private IBizGrassLivestockImbalanceWarningService service;

    @PreAuthorize("@ss.hasPermi('dataModel:grassLivestockImbalanceWarning:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizGrassLivestockImbalanceWarning query)
    {
        startPage();
        List<BizGrassLivestockImbalanceWarning> list = service.selectList(query);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('dataModel:grassLivestockImbalanceWarning:query')")
    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(service.selectById(id));
    }
}
