whycrzg
2021-02-20 aa885eba07f4b84390922b4b146d1806676293c0
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.Batt_param_low;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.UserRole;
import com.fgkj.services.Batt_param_lowService;
import com.google.gson.Gson;
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 javax.annotation.Resource;
 
@RequestMapping("battParamLow")
@RestController
@Api(tags = "battParamLow接口")
public class Batt_param_lowController{
 
    @Resource
    private Batt_param_lowService service;
 
    ServiceModel model = new ServiceModel();
 
    // private Batt_param_low blow;
    // private String blowstr;
 
    @GetMapping("all")
    @ApiOperation(notes = "",value="查询所有")
    public ServiceModel searchAll(){
        ServiceModel model=service.searchAll();
        //System.out.println(result);
        return model;
    }
 
    @PutMapping("updateAll")
    @ApiOperation(notes = "[{ \"low_type\": 1, \"low_nametype\": 1, \"low_value\": 0.0, \"low_method\": 0 }]",value="全部更新")
    public ServiceModel updateAll(@RequestBody List<Batt_param_low> list){
        Gson gson=new Gson();
        UserRole u=new UserRole();
        // List<Batt_param_low> list = gson.fromJson(blowstr, new TypeToken<List<Batt_param_low>>(){}.getType());
        ServiceModel model=service.update(list);
        return model;
    }
}