From 8cf143a196e20ddd68cbf9855290f2d3a0b78da0 Mon Sep 17 00:00:00 2001 From: whycxzp <perryhsu@163.com> Date: 星期五, 05 二月 2021 12:10:19 +0800 Subject: [PATCH] update --- src/main/java/com/fgkj/controller/Battresdata_infController.java | 63 +++++++++++++++---------------- 1 files changed, 30 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/fgkj/controller/Battresdata_infController.java b/src/main/java/com/fgkj/controller/Battresdata_infController.java index d648c52..faddd54 100644 --- a/src/main/java/com/fgkj/controller/Battresdata_infController.java +++ b/src/main/java/com/fgkj/controller/Battresdata_infController.java @@ -1,13 +1,10 @@ package com.fgkj.controller; -import com.fgkj.util.*; - import com.fgkj.dto.Battresdata_inf; import com.fgkj.dto.ServiceModel; import com.fgkj.services.Battresdata_infService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -20,67 +17,67 @@ @Resource private Battresdata_infService service; - ServiceModel model = new ServiceModel(); - // private Battresdata_inf brdi; - @PostMapping("/") - @ApiOperation(notes = "",value="鏂板") - public ServiceModel add(@RequestBody Battresdata_inf brdi) { - model = service.add(brdi); + @ApiOperation(value="鏂板") + public ServiceModel add(@RequestBody Battresdata_inf dataInf) { + ServiceModel model = service.add(dataInf); return model; } @PutMapping("/") - @ApiOperation(notes = "",value="淇敼") - public ServiceModel update(@RequestBody Battresdata_inf brdi) { - model = service.update(brdi); - - //System.out.println(result); + @ApiOperation(value="淇敼") + public ServiceModel update(@RequestBody Battresdata_inf dataInf) { + ServiceModel model = service.update(dataInf); return model; } @DeleteMapping("/") - @ApiOperation(notes = "",value="鍒犻櫎") - public ServiceModel delete(@RequestBody Battresdata_inf brdi) { - model = service.delete(brdi); - - //System.out.println(result); + @ApiOperation(value="鍒犻櫎") + public ServiceModel delete(@RequestParam int num) { + ServiceModel model = service.delete(num); return model; } @GetMapping("byCondition") - @ApiOperation(notes = "",value="绛涢�夊瓨鍦╞attresdata_inf琛ㄤ腑鐨勬暟鎹�") - public ServiceModel serchByCondition(@RequestBody Battresdata_inf brdi) { - model = service.serchByCondition(brdi); - - //System.out.println(result); + @ApiOperation(value="绛涢�夊瓨鍦╞attresdata_inf琛ㄤ腑鐨勬暟鎹�") + public ServiceModel serchByCondition(@RequestBody Battresdata_inf dataInf) { + ServiceModel model = service.serchByCondition(dataInf); return model; } @GetMapping("all") - @ApiOperation(notes = "",value="all") + @ApiOperation(value="all") public ServiceModel searchAll() { - model = service.searchAll(); - - //System.out.println(result); + ServiceModel model = service.searchAll(); return model; } //6.4.1鏍规嵁鏉′欢鏌ヨ绗﹀悎鏉′欢鐨勬祴璇曞畬鎴愮殑鐢垫睜缁�(钃勭數姹犵數瀵兼祴璇曞畬鎴愮巼) @GetMapping("complete") - @ApiOperation(notes = "",value="鏉′欢鏌ヨ绗﹀悎鏉′欢鐨勬祴璇曞畬鎴愮殑鐢垫睜缁�(钃勭數姹犵數瀵兼祴璇曞畬鎴愮巼)") - public ServiceModel serchComplete(@RequestBody Battresdata_inf b){ + @ApiOperation(value="鏉′欢鏌ヨ绗﹀悎鏉′欢鐨勬祴璇曞畬鎴愮殑鐢垫睜缁�(钃勭數姹犵數瀵兼祴璇曞畬鎴愮巼)") + public ServiceModel serchComplete(@RequestBody Battresdata_inf dataInf){ // Battresdata_inf b=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Battresdata_inf.class); - ServiceModel model=service.serchComplete(b); + ServiceModel model=service.serchComplete(dataInf); return model; } //6.4.3鏍规嵁鏉′欢鏌ヨ绗﹀悎鏉′欢鐨勬祴璇曞畬鎴愮殑鐢垫睜缁�(钃勭數姹犵數瀵煎悎鏍肩巼) @GetMapping("serRate") @ApiOperation(notes = "",value="鏉′欢鏌ヨ绗﹀悎鏉′欢鐨勬祴璇曞畬鎴愮殑鐢垫睜缁�(钃勭數姹犵數瀵煎悎鏍肩巼)") - public ServiceModel serchSer(@RequestBody Battresdata_inf b){ + public ServiceModel serchSer(@RequestBody Battresdata_inf dataInf){ // Battresdata_inf b=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Battresdata_inf.class); - ServiceModel model=service.serchSer(b); + ServiceModel model=service.serchSer(dataInf); + return model; + } + + //6.4.3鏍规嵁鏉′欢鏌ヨ绗﹀悎鏉′欢鐨勬祴璇曞畬鎴愮殑鐢垫睜缁�(钃勭數姹犵數瀵煎悎鏍肩巼) + @GetMapping("judge") + @ApiOperation(value="judge璋冭瘯") + public ServiceModel judge(@RequestParam int battGroupId){ + // Battresdata_inf b=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Battresdata_inf.class); + Battresdata_inf battresdata_inf = new Battresdata_inf(); + battresdata_inf.setBattGroupId(battGroupId); + ServiceModel model=service.judge(battresdata_inf); return model; } -- Gitblit v1.9.1