package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.service.PowerAlarmHistoryService; import com.whyc.service.PowerAlarmService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; 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 java.text.ParseException; @RestController @Api(tags = "电源告警") @RequestMapping("powerAlarm") public class PowerAlarmController { @Autowired private PowerAlarmService service; @Autowired private PowerAlarmHistoryService hisService; /*@ApiOperation("在用电源实时推送告警信息") @GetMapping("getResPowerAlm") public Response getResPowerAlm(@RequestParam(required = false) int pinfId){ Response res=service.getResPowerAlm(pinfId); return res; }*/ @ApiOperation("查询-分页") @GetMapping("getPage") public Response getPage(@RequestParam(required = false) Integer almLevel, @RequestParam String startTime, @RequestParam String endTime , @RequestParam int pageNum, @RequestParam int pageSize){ return service.getPage(almLevel,startTime,endTime,pageNum,pageSize); } @ApiOperation("确认告警") @GetMapping("confirmAlarm") public Response confirmAlarm(@RequestParam int num){ return service.confirmAlarm(num); } @ApiOperation("确认告警取消") @GetMapping("cancelAlarm") public Response cancelAlarm(@RequestParam int num){ return service.cancelAlarm(num); } @ApiOperation("查询历史-分页") @GetMapping("getHisPage") public Response getHisPage(@RequestParam(required = false) Integer almLevel,@RequestParam String startTime,@RequestParam String endTime , @RequestParam int pageNum, @RequestParam int pageSize) throws ParseException, InterruptedException { Response res=hisService.getHisPage(almLevel,startTime,endTime,pageNum,pageSize); return res; } }