lxw
2023-08-15 160e150009b51a39fa95d9462c3798ba28d51a09
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.PageParam;
import com.whyc.pojo.PageParam2;
import com.whyc.service.PageParamService;
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("pageParam")
@Api(tags = "系统设置-系统配置-页面参数")
public class PageParamController {
 
    @Autowired
    private PageParamService service;
 
    @GetMapping("allList")
    @ApiOperation(value = "查询待添加和已添加参数列表")
    public Response<Map<Integer, List<PageParam>>> getAllList(@RequestParam int categoryId){
        Map<Integer, List<PageParam>> map = service.getAllList(categoryId);
        return new Response<Map<Integer, List<PageParam>>>().set(1,map);
    }
 
    @GetMapping("list")
    @ApiOperation(value = "查询可用参数列表")
    public Response<List<PageParam>> getList(@RequestParam int categoryId){
        List<PageParam> paramList = service.getList(categoryId);
        return new Response<List<PageParam>>().set(1,paramList);
    }
 
    @PutMapping("list")
    @ApiOperation(value = "添加或者移除参数配置")
    public Response updateList(@RequestParam int operationFlag,@RequestBody List<PageParam> pageParamList){
        service.updateList(pageParamList,operationFlag);
        return new Response().setII(1,"更新成功");
    }
 
    @PostMapping("list")
    @ApiOperation(value = "新增参数配置",notes = "在用户从未配置过参数时添加调用本接口")
    public Response addList(@RequestBody List<PageParam> pageParamList){
        service.addList(pageParamList);
        return new Response().setII(1,"添加成功");
    }
 
    @GetMapping("findByCategoryId")
    @ApiOperation(value = "在线监测-查询拓扑图状态的显示/查询控制信息")
    public Response findByCategoryId(@RequestParam int categoryId){
        return service.findByCategoryId(categoryId);
    }
 
    @PostMapping("update")
    @ApiOperation(value = "修改参数状态")
    public Response update(@RequestParam int id, @RequestParam int status){
        return service.update(id,status);
    }
 
    @PostMapping("updateStatusList")
    @ApiOperation(value = "修改参数状态-批量")
    public Response updateStatusList(@RequestBody List<PageParam> pageParamList){
        return service.updateStatusList(pageParamList);
    }
 
    @PostMapping("updateParamById")
    @ApiOperation(value = "修改参数")
    public Response updateParamById(@RequestBody PageParam param){
        return service.updateParamById(param);
    }
 
    @GetMapping("getAuditCap")
    @ApiOperation("查询审计容量数")
    public Response getAuditCap(@RequestParam int categoryId) {
        return service.getListByCategoryId(categoryId);
    }
 
    @PostMapping("updateAuditCap")
    @ApiOperation("更新审计容量数据")
    public Response updateAuditCap(@RequestBody PageParam2 pageParam2) {
        return service.updateAudiCap(pageParam2);
    }
 
    @GetMapping("updateHisTime")
    @ApiOperation("更新放电优化时间")
    public Response updateHisTime(@RequestParam int id, @RequestParam int status) {
        return service.updateHisTime(id, status);
    }
 
}