| @@ -165,6 +165,13 @@ public interface WxCpService { | |||||
| */ | */ | ||||
| WxSession getSession(String id, boolean create); | WxSession getSession(String id, boolean create); | ||||
| /** | |||||
| * 获取WxSessionManager 对象 | |||||
| * | |||||
| * @return WxSessionManager | |||||
| */ | |||||
| WxSessionManager getSessionManager(); | |||||
| /** | /** | ||||
| * <pre> | * <pre> | ||||
| * 设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法, | * 设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法, | ||||
| @@ -285,6 +285,11 @@ public abstract class BaseWxCpServiceImpl<H, P> implements WxCpService, RequestH | |||||
| this.sessionManager = sessionManager; | this.sessionManager = sessionManager; | ||||
| } | } | ||||
| @Override | |||||
| public WxSessionManager getSessionManager() { | |||||
| return this.sessionManager; | |||||
| } | |||||
| @Override | @Override | ||||
| public String replaceParty(String mediaId) throws WxErrorException { | public String replaceParty(String mediaId) throws WxErrorException { | ||||
| String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty"; | String url = "https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty"; | ||||
| @@ -73,7 +73,7 @@ public class WxCpMessageRouter { | |||||
| this.wxCpService = wxCpService; | this.wxCpService = wxCpService; | ||||
| this.executorService = Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE); | this.executorService = Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE); | ||||
| this.messageDuplicateChecker = new WxMessageInMemoryDuplicateChecker(); | this.messageDuplicateChecker = new WxMessageInMemoryDuplicateChecker(); | ||||
| this.sessionManager = new StandardSessionManager(); | |||||
| this.sessionManager = wxCpService.getSessionManager(); | |||||
| this.exceptionHandler = new LogExceptionHandler(); | this.exceptionHandler = new LogExceptionHandler(); | ||||
| } | } | ||||