whyclxw
3 天以前 ebc94cfa52b28e954b2c182916f68caa96071b58
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
61
62
63
64
65
66
67
68
package com.whyc.controller;
 
import com.whyc.dto.Real.AlmDto;
import com.whyc.dto.Response;
import com.whyc.pojo.db_alarm.BattalarmData;
import com.whyc.pojo.db_alarm.DevalarmData;
import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarm;
import com.whyc.service.BattalarmDataService;
import com.whyc.service.DevalarmDataService;
import com.whyc.service.PwrdevAlarmService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RestController
@Api(tags = "告警管理")
@RequestMapping("alm")
public class AlarmController {
    @Autowired
    private BattalarmDataService battalarmDataService;
 
    @Autowired
    private DevalarmDataService devalarmDataService;
 
    @Autowired
    private PwrdevAlarmService pwrdevAlarmService;
 
    @PostMapping("getBattAlmReal")
    @ApiOperation("获取电池组实时告警信息")
    public Response getBattAlmReal(@RequestBody AlmDto almDto){
        almDto.setUid(ActionUtil.getUser().getId());
        return battalarmDataService.getBattAlmReal(almDto);
    }
 
    @PostMapping("getDevAlmReal")
    @ApiOperation("获取设备实时告警信息")
    public Response getDevAlmReal(@RequestBody AlmDto almDto){
        almDto.setUid(ActionUtil.getUser().getId());
        return devalarmDataService.getDevAlmReal(almDto);
    }
 
    @PostMapping("getPwrAlmReal")
    @ApiOperation("获取电源实时告警信息")
    public Response getPwrAlmReal(@RequestBody AlmDto almDto){
        almDto.setUid(ActionUtil.getUser().getId());
        return pwrdevAlarmService.getPwrAlmReal(almDto);
    }
 
    @GetMapping("updateBattConfrim")
    @ApiOperation(value = "确认电池告警")
    public Response updateBattConfrim(@RequestParam Integer num){
        return battalarmDataService.updateBattConfrim(num);
    }
 
    @GetMapping("updateDevConfrim")
    @ApiOperation(value = "确认设备告警")
    public Response updateDevConfrim(@RequestParam Integer num){
        return devalarmDataService.updateDevConfrim(num);
    }
 
    @GetMapping("updatePwrConfrim")
    @ApiOperation(value = "确认电源告警")
    public Response updatePwrConfrim(@RequestParam Integer num){
        return pwrdevAlarmService.updatePwrConfrim(num);
    }
}