whyclxw
2025-03-29 b2304cfc3342211dfd161de427879fa813a22a44
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.AppAlmParam;
import com.whyc.pojo.PageParam;
import com.whyc.service.AppAlmParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
 
@RestController
@RequestMapping("appAlmParam")
@Api(tags = "告警消失参数设置")
public class AppAlmParamController {
 
    @Autowired
    private AppAlmParamService service;
 
    @GetMapping("allList")
    @ApiOperation(value = "查询待添加和已添加参数列表")
    public Response<Map<Integer, Map<Integer, List<AppAlmParam>>>> getAllList(){
        Map<Integer, Map<Integer, List<AppAlmParam>>> map = service.getAllList();
        return new Response<Map<Integer, Map<Integer, List<AppAlmParam>>>>().set(1,map);
    }
 
    @GetMapping("listToBeConfirmed")
    @ApiOperation(value = "查询待确认的告警类型列表")
    public Response<List<Integer>> getListToBeConfirmed(@RequestParam Integer type){
        List<Integer> list = service.getListToBeConfirmed(type);
        return new Response<List<Integer>>().set(1,list);
    }
 
    @GetMapping("allList2")
    @ApiOperation(value = "查询参数列表")
    public Response<List<AppAlmParam>> getAllList2(){
        List<AppAlmParam> list = service.getAllList2();
        return new Response<List<AppAlmParam>>().set(1,list);
    }
 
    @PostMapping("list")
    @ApiOperation(value = "添加或者移除参数配置")
    public Response updateList(@RequestParam int operationFlag,@RequestBody List<AppAlmParam> paramList){
        service.updateList(paramList,operationFlag);
        return new Response().setII(1,"更新成功");
    }
 
    @PostMapping("list2")
    @ApiOperation(value = "更新参数配置")
    public Response updateList2(@RequestBody List<AppAlmParam> paramList){
        service.updateList2(paramList);
        return new Response().setII(1,"更新成功");
    }
 
 
}