|
|
|
@@ -17,7 +17,6 @@ import redis.clients.util.Pool; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
@Component |
|
|
|
public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { |
|
|
|
private final static String COMPONENT_VERIFY_TICKET_KEY = "wechat_component_verify_ticket:"; |
|
|
|
private final static String COMPONENT_ACCESS_TOKEN_KEY = "wechat_component_access_token:"; |
|
|
|
@@ -28,6 +27,10 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { |
|
|
|
private final static String CARD_API_TICKET_KEY = "wechat_card_api_ticket:"; |
|
|
|
|
|
|
|
protected final Pool<Jedis> jedisPool; |
|
|
|
private WxComponentVerifyTicketMapper wxComponentVerifyTicketMapper; |
|
|
|
private WxAuthorizerInfoMapper wxAuthorizerInfoMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* redis 存储的 key 的前缀,可为空 |
|
|
|
*/ |
|
|
|
@@ -41,24 +44,9 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { |
|
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxComponentVerifyTicketMapper wxComponentVerifyTicketMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxAuthorizerInfoMapper wxAuthorizerInfoMapper; |
|
|
|
|
|
|
|
public WxOpenInRedisDBConfigStorage() { |
|
|
|
this.jedisPool = null; |
|
|
|
} |
|
|
|
|
|
|
|
public WxOpenInRedisDBConfigStorage(Pool<Jedis> jedisPool) { |
|
|
|
this.jedisPool = jedisPool; |
|
|
|
if(wxAuthorizerInfoMapper == null) { |
|
|
|
logger.info("wxAuthorizerInfoMapper is null"); |
|
|
|
} |
|
|
|
if(wxComponentVerifyTicketMapper == null) { |
|
|
|
logger.info("wxComponentVerifyTicketMapper is null"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public WxOpenInRedisDBConfigStorage(Pool<Jedis> jedisPool, String keyPrefix) { |
|
|
|
@@ -66,8 +54,10 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { |
|
|
|
this.keyPrefix = keyPrefix; |
|
|
|
} |
|
|
|
|
|
|
|
public WxOpenInRedisDBConfigStorage(JedisPool jedisPool) { |
|
|
|
public WxOpenInRedisDBConfigStorage(JedisPool jedisPool, WxComponentVerifyTicketMapper componentVerifyTicketMapper, WxAuthorizerInfoMapper authorizerInfoMapper) { |
|
|
|
this.jedisPool = jedisPool; |
|
|
|
this.wxComponentVerifyTicketMapper = componentVerifyTicketMapper; |
|
|
|
this.wxAuthorizerInfoMapper = authorizerInfoMapper; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|