perryhsu
2020-10-17 a543f4de1c91ef6f43aace92975c6cf28de23618
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Battresdata;
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.BattresdataService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RequestMapping("battResData")
@RestController
@Api
public class BattresdataController {
 
    @Autowired
    private BattresdataService service;
 
    // private Battresdata brd;
 
     //根据电池组id和单体id查询内阻历史信息
    @GetMapping("monHistory")
    public ServiceModel serchByMonHistory(@RequestBody BattInf binf) {
        // BattInf binf=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
        ServiceModel model = service.serchByMonHistory(binf);
        return model;
    }
 
    @PostMapping("/")
    public ServiceModel add(@RequestBody Battresdata brd) {
        ServiceModel model = service.add(brd);
        return model;
    }
 
    @PutMapping("/")
    public ServiceModel update(@RequestBody Battresdata brd) {
        ServiceModel model = service.update(brd);
        return model;
    }
 
    @DeleteMapping("/")
    public ServiceModel delete(@RequestBody Battresdata brd) {
        ServiceModel model = service.delete(brd);
        return model;
    }
 
    @GetMapping("byCondition")
    public ServiceModel serchByCondition(@RequestBody Battresdata brd) {
        
        ServiceModel model = service.serchByCondition(brd);
        return model;
    }
 
    @GetMapping("all")
    public ServiceModel searchAll(@RequestBody Battresdata brd) {
        ServiceModel model = service.searchAll(brd);
        return model;
    }
 
}