whycrzh
2021-01-28 c8332186836b3dfe1fbd32d7bec7cd29a57e1888
src/main/java/com/fgkj/controller/App_ParamController.java
@@ -5,6 +5,7 @@
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.App_ParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -13,26 +14,25 @@
@RequestMapping("appParam")
@RestController
@Api
@Api(tags = "appParam接口")
public class App_ParamController{
   @Resource
   private App_ParamService service;
   @Autowired
   private DatasourceConfig datasourceConfig;
   //根据discharge/charge/poweroff查询
   @GetMapping("byInfo")
   public ServiceModel serchByInfo(@RequestBody App_Param param) {
      // App_Param param = getGson().fromJson(json, App_Param.class);
   @PostMapping("byInfo")
   @ApiOperation(notes = "",value="byInfo")
   public ServiceModel serchByInfo(@RequestParam String param_name) {
      App_Param param = new App_Param();
      param.setParam_name(param_name);
      ServiceModel model = service.serchByInfo(param);
      return model;
   }
   //修改参数
   @PutMapping("/")
   @ApiOperation(notes = "[{ \"num\": 1, \"param_value\": 11 }]",value="修改参数")
   public ServiceModel update(@RequestBody List<App_Param> params) {
      // List<App_Param> params = getGson().fromJson(json, new TypeToken<List<App_Param>>(){}.getType());
      ServiceModel model = service.update(params);
@@ -44,6 +44,7 @@
    * @return
    */
   @GetMapping("ip")
   @ApiOperation(notes = "",value="获取连接数据库的ip地址")
   public ServiceModel searchIP(){
      //jdbc:mysql://localhost:3360/db_user?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
      String url = datasourceConfig.getUrl();
@@ -64,6 +65,7 @@
    * @return
    */
   @PutMapping("ip")
   @ApiOperation(notes = "设置服务器ip地址,TODO",value="设置服务器ip地址")
   public ServiceModel updataIp(@RequestParam String json){
      // ServiceModel model = DBUtil1.setIp(json);