|
|
@ -205,37 +205,38 @@ public class HighUserController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/setUserParam",method = RequestMethod.GET) |
|
|
|
@RequestMapping(value="/setCacheParam",method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "设置用户参数") |
|
|
|
@ApiOperation(value = "设置用户参数") |
|
|
|
public ResponseData setUserParam(@RequestParam(name = "param", required = true) String param,HttpServletRequest request) { |
|
|
|
public ResponseData setCacheParam(@RequestBody JSONObject body) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
// 用户
|
|
|
|
if (body == null |
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|| StringUtils.isBlank(body.getString("key")) |
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
|| StringUtils.isBlank(body.getString("value"))) { |
|
|
|
|
|
|
|
log.error("HighUserController --> setUserPayPwd() error!", "请求参数校验失败"); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
redisUtil.hset("USER_PARAM", userInfoModel.getHighUser().getPhone(), param, 60*60*60); |
|
|
|
redisUtil.hset("PROVISIONAL_CACHE_PARAM", body.getString("key"), body.getString("value"), 60*5); |
|
|
|
return ResponseMsgUtil.success(redisUtil.hget("USER_PARAM", userInfoModel.getHighUser().getPhone())); |
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("设置成功"); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("CommonController --> getDictionaryByCodeTypeAndValue() error!", e); |
|
|
|
log.error("CommonController --> setCacheParam() error!", e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getUserParam",method = RequestMethod.GET) |
|
|
|
@RequestMapping(value="/getCacheParam",method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "获取设置用户参数") |
|
|
|
@ApiOperation(value = "获取设置用户参数") |
|
|
|
public ResponseData getUserParam(HttpServletRequest request) { |
|
|
|
public ResponseData getCacheParam(@RequestParam(name = "key", required = true) String key) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
// 用户
|
|
|
|
|
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(redisUtil.hget("USER_PARAM", userInfoModel.getHighUser().getPhone())); |
|
|
|
return ResponseMsgUtil.success(redisUtil.hget("PROVISIONAL_CACHE_PARAM", key)); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("CommonController --> getDictionaryByCodeTypeAndValue() error!", e); |
|
|
|
log.error("CommonController --> getCacheParam() error!", e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|