diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java index 821d39c5..efb82c4f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserController.java @@ -5,6 +5,7 @@ import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.*; +import com.hai.common.utils.RedisUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighOrder; import com.hai.entity.HighUser; @@ -57,6 +58,9 @@ public class HighUserController { @Resource private HighUserPayPasswordService highUserPayPasswordService; + @Resource + private RedisUtil redisUtil; + @RequestMapping(value = "/findUser", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据id查询详情") @@ -201,5 +205,40 @@ public class HighUserController { } } + @RequestMapping(value="/setUserParam",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "设置用户参数") + public ResponseData setUserParam(@RequestParam(name = "param", required = true) String param,HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + redisUtil.hset("USER_PARAM", userInfoModel.getHighUser().getPhone(), param, 60*60*60); + return ResponseMsgUtil.success(redisUtil.hget("USER_PARAM", userInfoModel.getHighUser().getPhone())); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeTypeAndValue() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getUserParam",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取设置用户参数") + public ResponseData getUserParam(HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + return ResponseMsgUtil.success(redisUtil.hget("USER_PARAM", userInfoModel.getHighUser().getPhone())); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeTypeAndValue() error!", e); + return ResponseMsgUtil.exception(e); + } + } + }