记得上下班打卡 | git大法好,push需谨慎

Commit 54a9ce34 authored by jiangxiulong's avatar jiangxiulong

adam token redis

parent f6c02cd4
...@@ -3,8 +3,12 @@ package com.liquidnet.service.adam.config; ...@@ -3,8 +3,12 @@ package com.liquidnet.service.adam.config;
import cn.binarywang.wx.miniapp.api.WxMaService; import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl;
import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
...@@ -67,11 +71,17 @@ public class WechatMaConfigure { ...@@ -67,11 +71,17 @@ public class WechatMaConfigure {
private WxMaService wxMaAppletFiveService; private WxMaService wxMaAppletFiveService;
private WxMaService wxMaAppletMdskService; private WxMaService wxMaAppletMdskService;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@PostConstruct @PostConstruct
public void init() { public void init() {
wxMaAppletZhengzaiService = new WxMaServiceImpl() { wxMaAppletZhengzaiService = new WxMaServiceImpl() {
{ {
WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl(); RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "adam:accessToken:applet:zhengzai");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidZhengzai); wxMaDefaultConfig.setAppid(appletAppidZhengzai);
wxMaDefaultConfig.setSecret(appletSecretZhengzai); wxMaDefaultConfig.setSecret(appletSecretZhengzai);
wxMaDefaultConfig.setMsgDataFormat("JSON"); wxMaDefaultConfig.setMsgDataFormat("JSON");
...@@ -81,7 +91,10 @@ public class WechatMaConfigure { ...@@ -81,7 +91,10 @@ public class WechatMaConfigure {
}; };
wxMaAppletStrawberryService = new WxMaServiceImpl() { wxMaAppletStrawberryService = new WxMaServiceImpl() {
{ {
WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl(); RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:strawberry");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidStrawberry); wxMaDefaultConfig.setAppid(appletAppidStrawberry);
wxMaDefaultConfig.setSecret(appletSecretStrawberry); wxMaDefaultConfig.setSecret(appletSecretStrawberry);
wxMaDefaultConfig.setMsgDataFormat("JSON"); wxMaDefaultConfig.setMsgDataFormat("JSON");
...@@ -91,7 +104,10 @@ public class WechatMaConfigure { ...@@ -91,7 +104,10 @@ public class WechatMaConfigure {
}; };
wxMaAppletFiveService = new WxMaServiceImpl() { wxMaAppletFiveService = new WxMaServiceImpl() {
{ {
WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl(); RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:five");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidFive); wxMaDefaultConfig.setAppid(appletAppidFive);
wxMaDefaultConfig.setSecret(appletSecretFive); wxMaDefaultConfig.setSecret(appletSecretFive);
wxMaDefaultConfig.setMsgDataFormat("JSON"); wxMaDefaultConfig.setMsgDataFormat("JSON");
...@@ -101,7 +117,10 @@ public class WechatMaConfigure { ...@@ -101,7 +117,10 @@ public class WechatMaConfigure {
}; };
wxMaAppletMdskService = new WxMaServiceImpl() { wxMaAppletMdskService = new WxMaServiceImpl() {
{ {
WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl(); RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:mdsk");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidMdsk); wxMaDefaultConfig.setAppid(appletAppidMdsk);
wxMaDefaultConfig.setSecret(appletSecretMdsk); wxMaDefaultConfig.setSecret(appletSecretMdsk);
wxMaDefaultConfig.setMsgDataFormat("JSON"); wxMaDefaultConfig.setMsgDataFormat("JSON");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment