package com.huimv.produce.warning.controller;

import com.dahuatech.icc.exception.ClientException;
import com.huimv.common.utils.Result;
import com.huimv.produce.warning.service.IAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @Project : huimv.shiwan
 * @Package : com.huimv.biosafety.uface.controller
 * @Description : TODO
 * @Version : 1.0
 * @Author : ZhuoNing
 * @Create : 2020-12-25
 **/
@RestController
@Slf4j
@RequestMapping(value = "/warning")
public class AlarmController {
    @Autowired
    private IAlarmService iAlarmService;

    @RequestMapping(value = "/getMainPageWarning",method = RequestMethod.GET)
    public Result getMainPage(@RequestParam(value = "farmId",required = true) Integer farmId) throws ParseException, ClientException {
        //读取首页告警
        return iAlarmService.getMainPageAlarm(farmId);
    }

}
