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