AlarmController.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.huimv.env.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONArray;
  4. import com.alibaba.fastjson.JSONObject;
  5. import com.huimv.common.utils.Result;
  6. import com.huimv.env.service.IAlarm;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.*;
  10. import java.text.ParseException;
  11. /**
  12. * @Project : huimv.shiwan
  13. * @Package : com.huimv.biosafety.uface.controller
  14. * @Description : TODO
  15. * @Version : 1.0
  16. * @Author : ZhuoNing
  17. * @Create : 2020-12-25
  18. **/
  19. @CrossOrigin
  20. @RestController
  21. @RequestMapping("/alarm")
  22. @Slf4j
  23. public class AlarmController {
  24. @Autowired
  25. private IAlarm iAlarm;
  26. @RequestMapping(value = "/getAlarm",method = RequestMethod.GET)
  27. public Result getAlarmByFarmIdAndDate(@RequestParam(value = "farmId",required = true) Integer farmId,
  28. @RequestParam(value="alarmType",required=false) Integer alarmType,
  29. @RequestParam(value = "alarmDate",required=false) String alarmDate,
  30. @RequestParam(value = "pageSize",required=false) Integer pageSize,
  31. @RequestParam(value = "pageNo") Integer pageNo) throws ParseException {
  32. log.info("farmId>>"+farmId);
  33. log.info("alarmType>>"+alarmType);
  34. log.info("alarmDate>>"+alarmDate);
  35. log.info("pageNo>>"+pageNo);
  36. log.info("pageSize>>"+pageSize);
  37. //
  38. return iAlarm.getAlarm(farmId,alarmType,alarmDate,pageNo,pageSize);
  39. }
  40. }