whycxzp
2025-04-25 1059492cab966417e1cadd41f5d091cee5af1a8b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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;
    }
}