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

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
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.BizYakDiseaseWarning;
import com.ruoyi.web.modules.industryservice.service.IBizYakDiseaseWarningService;

/**
 * 移动端健康预警（读牦牛疾病预警表）。
 * <p>
 * Base：{@code /app/healthAlert}。<br>
 * 与管理端共用 {@link IBizYakDiseaseWarningService}，仅提供列表与详情，无同步入口。
 * </p>
 */
@RestController
@RequestMapping("/app/healthAlert")
public class BizAppHealthAlertController extends BaseController
{
    @Autowired
    private IBizYakDiseaseWarningService bizYakDiseaseWarningService;

    /** 分页列表，筛选字段与管理端一致。 */
    @GetMapping("/list")
    public TableDataInfo list(BizYakDiseaseWarning query)
    {
        startPage();
        List<BizYakDiseaseWarning> list = bizYakDiseaseWarningService.selectBizYakDiseaseWarningList(query);
        return getDataTable(list);
    }

    /** 详情；可附带关联牦牛档案 ID。 */
    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(bizYakDiseaseWarningService.selectBizYakDiseaseWarningById(id, null));
    }
}
