whycrzh
2021-01-23 d1491636bcc06c9bb23b4955c3d8d0bfe7749e6d
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.Batt_discharge;
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.Batt_dischargeService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import javax.annotation.Resource;
 
@RequestMapping("battDischarge")
@RestController
@Api
public class Batt_dischargeController{
 
    @Resource
    private Batt_dischargeService service;
 
    
     //批量添加
    @PostMapping("/")
    public ServiceModel  add(@RequestBody List<Batt_discharge> list) {
        // List<Batt_discharge> list=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, new TypeToken<List<Batt_discharge>>(){}.getType());
        ServiceModel model=service.add(list);
 
        return model;
    }
    //移除黑名单
    @DeleteMapping("/")
    public ServiceModel  del(@RequestBody List<Batt_discharge> list) {
        // List<Batt_discharge> list=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, new TypeToken<List<Batt_discharge>>(){}.getType());
        ServiceModel model=service.del(list);
 
        return model;
    }
     //根据设备id查询改设备是否被加入至黑名单
    @GetMapping("byCondition")
    public ServiceModel  serchByCondition(@RequestBody Batt_discharge bd) {
        // Batt_discharge bd=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_discharge.class);
        ServiceModel model=service.serchByCondition(bd);
 
        return model;
    }
    //根据省市区县机房信息查询出所有不能放电的站
    @GetMapping("all")
    public ServiceModel  searchAll() {
        ServiceModel model=service.searchAll();
 
        return model;
    }
    //根据省市区县机房信息查询出所有能放电的站
    @GetMapping("allNotIn")
    public ServiceModel  searchAllNotIn() {
        ServiceModel model=service.searchAllNotIn();
 
        return model;
    }
 
    
    
 
}