SaasCommonController.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.persagy.account.controller;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.data.redis.core.RedisTemplate;
  4. import org.springframework.validation.annotation.Validated;
  5. import org.springframework.web.bind.annotation.RequestBody;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestMethod;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import com.persagy.account.pojo.vo.BaseGroupVO;
  10. import com.persagy.common.constant.SaasCommonConstant;
  11. import com.persagy.common.utils.ResponseResult;
  12. import com.persagy.common.utils.ResponseResultUtil;
  13. import com.persagy.security.constant.CipherConstants;
  14. import io.swagger.annotations.Api;
  15. import io.swagger.annotations.ApiOperation;
  16. /**
  17. * 通用controller
  18. *
  19. * @version 1.0.0
  20. * @company persagy
  21. * @author zhangqiankun
  22. * @date 2021-04-26 15:29:50
  23. */
  24. @Api(tags = "通用接口管理")
  25. @RestController
  26. @RequestMapping(value = "/common", method = RequestMethod.POST)
  27. public class SaasCommonController {
  28. @Autowired
  29. private RedisTemplate<String, Object> redisTemplate;
  30. /**
  31. * 查询菜单历史记录
  32. */
  33. @ApiOperation(value = "查询菜单历史记录")
  34. @RequestMapping(value = "test")
  35. public ResponseResult test(@RequestBody @Validated BaseGroupVO model) {
  36. this.redisTemplate.opsForSet().add(SaasCommonConstant.SAAS_CLIENT_ID_REDIS_KEY, "EF4C04481E604506995AF5CF5BF2E395");
  37. this.redisTemplate.opsForHash().put("EF4C04481E604506995AF5CF5BF2E395", CipherConstants.INNER_CLIENT_HASH_KEY, true);
  38. return ResponseResultUtil.successResult();
  39. }
  40. }