whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
src/main/java/com/fgkj/controller/Batt_param_lowController.java
@@ -8,39 +8,42 @@
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
@Api(tags = "battParamLow接口")
public class Batt_param_lowController{
   @Autowired
   @Resource
   private Batt_param_lowService service;
   private ServiceModel model;
   ServiceModel model = new ServiceModel();
   // private Batt_param_low blow;
   // private String blowstr;
   @GetMapping("all")
   @ApiOperation(notes = "",value="查询所有")
   public ServiceModel searchAll(){
      model=service.searchAll();
      ServiceModel model=service.searchAll();
      //System.out.println(result);
      return model;
   }
   @PutMapping("all")
   @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());
      for(int i=0;i<list.size();i++){
         model=service.update(list.get(i));
      }
      ServiceModel model=service.update(list);
      return model;
   }
}