SaasCommonController.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 io.swagger.annotations.Api;
  14. import io.swagger.annotations.ApiOperation;
  15. /**
  16. * 通用controller
  17. *
  18. * @version 1.0.0
  19. * @company persagy
  20. * @author zhangqiankun
  21. * @date 2021-04-26 15:29:50
  22. */
  23. @Api(tags = "通用接口管理")
  24. @RestController
  25. @RequestMapping(value = "/common", method = RequestMethod.POST)
  26. public class SaasCommonController {
  27. @Autowired
  28. private RedisTemplate<String, Object> redisTemplate;
  29. /**
  30. * 查询菜单历史记录
  31. */
  32. @ApiOperation(value = "查询菜单历史记录")
  33. @RequestMapping(value = "test")
  34. public ResponseResult test(@RequestBody @Validated BaseGroupVO model) {
  35. this.redisTemplate.opsForSet().add(SaasCommonConstant.SAAS_CLIENT_ID_REDIS_KEY, "EF4C04481E604506995AF5CF5BF2E395");
  36. this.redisTemplate.opsForHash().put("EF4C04481E604506995AF5CF5BF2E395", SaasCommonConstant.INNER_CLIENT_REDIS_HASH_KEY, true);
  37. return ResponseResultUtil.successResult();
  38. }
  39. }