|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.redis; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.constant.ThirdRedisKeyConstant; |
|
|
|
import com.epmet.dto.form.AuthCodeFormDTO; |
|
|
@ -10,6 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import static com.epmet.commons.tools.redis.RedisUtils.NOT_EXPIRE; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author zxc |
|
|
|
* @CreateTime 2020/7/7 9:33 |
|
|
@ -74,8 +79,9 @@ public class RedisThird { |
|
|
|
* @author zxc |
|
|
|
*/ |
|
|
|
public void setAuthorizerRefreshToken(AuthorizationInfoFormDTO authInfoDTO){ |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(authInfoDTO, false, true); |
|
|
|
String key = ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY + ThirdRedisKeyConstant.COLON + authInfoDTO.getCustomerId()+ThirdRedisKeyConstant.COLON+authInfoDTO.getClientType(); |
|
|
|
redisUtils.set(key,authInfoDTO,-1); |
|
|
|
redisUtils.hMSet(key, map,NOT_EXPIRE); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -83,8 +89,9 @@ public class RedisThird { |
|
|
|
* @param key = epmet:wechartthird:authorizerrefreshtoken:customerId:clientType 前缀+客户ID+客户端类型 |
|
|
|
* @author zxc |
|
|
|
*/ |
|
|
|
public String getAuthorizerRefreshToken(String key){ |
|
|
|
return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY+key).toString(); |
|
|
|
public Map<String,Object> getAuthorizerRefreshToken(String key){ |
|
|
|
Map<String, Object> result = redisUtils.hGetAll(ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY + key); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|