zoukankan      html  css  js  c++  java
  • api controller 接口接收json字符串参数

    {"data":{"alarmRepeatTimes":2,"currentMode":1,"moduleResetTimeout":3,"otherInterval":4,"statusInterval":5},"devEuiList":["3237383162378A01","3238313953367222"]}

    @RequestMapping(value ="setting/olc",method = RequestMethod.POST)
    @ResponseBody
    public ResponseResult multipleSetting(@RequestBody String body){
    LogUtils.infoLog(getClass().getSimpleName(), "multipleSetting", logger,
    LogUtils.ActionDirection.DIRECTION_LOCAL, "multipleSetting settingDto :" , Json.toJson(body));
    JSONObject jb = Json.fromJson(body,JSONObject.class);
    String dataJson = jb.getAsString("data");
    SettingDto settingDto = Json.fromJson(dataJson,SettingDto.class);
    TbSetting tbSetting = new TbSetting();
    tbSetting.setCurrentMode(settingDto.getCurrentMode());
    tbSetting.setStatusUpdateInterval(settingDto.getStatusInterval());
    tbSetting.setOtherUpdateInterval(settingDto.getOtherInterval());
    tbSetting.setAlarmRepeatTime(settingDto.getAlarmRepeatTimes());
    tbSetting.setModuleReset(settingDto.getModuleResetTimeout());
    tbSetting.setCreateTime(new Date());
    List<String> devlist = (List<String>)jb.get("devEuiList");

    adminService.multipleSetting(tbSetting,devlist);
    ResponseResult responseResult = new ResponseResult();
    return responseResult;
    }
  • 相关阅读:
    sqlserver 保留2位小数的写法
    Kettle 数据预览 乱码
    finereport 数据分析预览 居中 参数分割 自动查询
    Unable to locate value meta plugin of type (id)
    mysql8.0
    MySQL 搭建MHA高可用架构
    Java性能调优工具
    helm 部署etcd
    阿里云pv 使用
    ldconfig 引起的事故
  • 原文地址:https://www.cnblogs.com/zhaoblog/p/9472792.html
Copyright © 2011-2022 走看看