| @@ -11,7 +11,7 @@ import com.github.binarywang.demo.spring.handler.MenuHandler; | |||||
| @Component | @Component | ||||
| @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||
| public class Gzh1MenuHadler extends MenuHandler { | |||||
| public class Gzh1MenuHandler extends MenuHandler { | |||||
| @Autowired | @Autowired | ||||
| private WxGzh1Config wxConfig; | private WxGzh1Config wxConfig; | ||||
| @@ -11,7 +11,7 @@ import com.github.binarywang.demo.spring.handler.MsgHandler; | |||||
| @Component | @Component | ||||
| @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||
| public class Gzh1MsgHadler extends MsgHandler { | |||||
| public class Gzh1MsgHandler extends MsgHandler { | |||||
| @Autowired | @Autowired | ||||
| private WxGzh1Config wxConfig; | private WxGzh1Config wxConfig; | ||||
| @@ -14,7 +14,7 @@ import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage; | |||||
| @Component | @Component | ||||
| @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||
| public class Gzh1SubscribeHadler extends SubscribeHandler { | |||||
| public class Gzh1SubscribeHandler extends SubscribeHandler { | |||||
| @Autowired | @Autowired | ||||
| private WxGzh1Config wxConfig; | private WxGzh1Config wxConfig; | ||||
| @@ -11,7 +11,7 @@ import com.github.binarywang.demo.spring.handler.UnsubscribeHandler; | |||||
| @Component | @Component | ||||
| @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||
| public class Gzh1UnSubscribeHadler extends UnsubscribeHandler { | |||||
| public class Gzh1UnSubscribeHandler extends UnsubscribeHandler { | |||||
| @Autowired | @Autowired | ||||
| private WxGzh1Config wxConfig; | private WxGzh1Config wxConfig; | ||||
| @@ -1,21 +1,7 @@ | |||||
| package com.github.binarywang.demo.spring.service; | package com.github.binarywang.demo.spring.service; | ||||
| import javax.annotation.PostConstruct; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import com.github.binarywang.demo.spring.config.WxConfig; | import com.github.binarywang.demo.spring.config.WxConfig; | ||||
| import com.github.binarywang.demo.spring.handler.AbstractHandler; | |||||
| import com.github.binarywang.demo.spring.handler.KfSessionHandler; | |||||
| import com.github.binarywang.demo.spring.handler.LogHandler; | |||||
| import com.github.binarywang.demo.spring.handler.MenuHandler; | |||||
| import com.github.binarywang.demo.spring.handler.MsgHandler; | |||||
| import com.github.binarywang.demo.spring.handler.NullHandler; | |||||
| import com.github.binarywang.demo.spring.handler.SubscribeHandler; | |||||
| import com.github.binarywang.demo.spring.handler.UnsubscribeHandler; | |||||
| import com.github.binarywang.demo.spring.handler.*; | |||||
| import me.chanjar.weixin.common.api.WxConsts; | import me.chanjar.weixin.common.api.WxConsts; | ||||
| import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; | import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; | ||||
| import me.chanjar.weixin.mp.api.WxMpMessageRouter; | import me.chanjar.weixin.mp.api.WxMpMessageRouter; | ||||
| @@ -23,6 +9,11 @@ import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; | |||||
| import me.chanjar.weixin.mp.bean.WxMpXmlMessage; | import me.chanjar.weixin.mp.bean.WxMpXmlMessage; | ||||
| import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage; | import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage; | ||||
| import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfOnlineList; | import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfOnlineList; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import javax.annotation.PostConstruct; | |||||
| /** | /** | ||||
| * | * | ||||
| @@ -125,8 +116,7 @@ public abstract class BaseWxService extends WxMpServiceImpl { | |||||
| public WxMpXmlOutMessage route(WxMpXmlMessage message) { | public WxMpXmlOutMessage route(WxMpXmlMessage message) { | ||||
| try { | try { | ||||
| final WxMpXmlOutMessage responseMessage = this.router.route(message); | |||||
| return responseMessage; | |||||
| return this.router.route(message); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| this.logger.error(e.getMessage(), e); | this.logger.error(e.getMessage(), e); | ||||
| } | } | ||||
| @@ -11,10 +11,10 @@ import com.github.binarywang.demo.spring.handler.MsgHandler; | |||||
| import com.github.binarywang.demo.spring.handler.SubscribeHandler; | import com.github.binarywang.demo.spring.handler.SubscribeHandler; | ||||
| import com.github.binarywang.demo.spring.handler.UnsubscribeHandler; | import com.github.binarywang.demo.spring.handler.UnsubscribeHandler; | ||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1LocationHandler; | import com.github.binarywang.demo.spring.handler.gzh1.Gzh1LocationHandler; | ||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1MenuHadler; | |||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1MsgHadler; | |||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1SubscribeHadler; | |||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1UnSubscribeHadler; | |||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1MenuHandler; | |||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1MsgHandler; | |||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1SubscribeHandler; | |||||
| import com.github.binarywang.demo.spring.handler.gzh1.Gzh1UnSubscribeHandler; | |||||
| /** | /** | ||||
| * | * | ||||
| @@ -30,16 +30,16 @@ public class Gzh1WxService extends BaseWxService { | |||||
| private Gzh1LocationHandler locationHandler; | private Gzh1LocationHandler locationHandler; | ||||
| @Autowired | @Autowired | ||||
| private Gzh1MenuHadler menuHadler; | |||||
| private Gzh1MenuHandler menuHandler; | |||||
| @Autowired | @Autowired | ||||
| private Gzh1MsgHadler msgHadler; | |||||
| private Gzh1MsgHandler msgHandler; | |||||
| @Autowired | @Autowired | ||||
| private Gzh1UnSubscribeHadler unSubscribeHadler; | |||||
| private Gzh1UnSubscribeHandler unSubscribeHandler; | |||||
| @Autowired | @Autowired | ||||
| private Gzh1SubscribeHadler subscribeHadler; | |||||
| private Gzh1SubscribeHandler subscribeHandler; | |||||
| @Override | @Override | ||||
| protected WxConfig getServerConfig() { | protected WxConfig getServerConfig() { | ||||
| @@ -48,17 +48,17 @@ public class Gzh1WxService extends BaseWxService { | |||||
| @Override | @Override | ||||
| protected MenuHandler getMenuHandler() { | protected MenuHandler getMenuHandler() { | ||||
| return this.menuHadler; | |||||
| return this.menuHandler; | |||||
| } | } | ||||
| @Override | @Override | ||||
| protected SubscribeHandler getSubscribeHandler() { | protected SubscribeHandler getSubscribeHandler() { | ||||
| return this.subscribeHadler; | |||||
| return this.subscribeHandler; | |||||
| } | } | ||||
| @Override | @Override | ||||
| protected UnsubscribeHandler getUnsubscribeHandler() { | protected UnsubscribeHandler getUnsubscribeHandler() { | ||||
| return this.unSubscribeHadler; | |||||
| return this.unSubscribeHandler; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -68,7 +68,7 @@ public class Gzh1WxService extends BaseWxService { | |||||
| @Override | @Override | ||||
| protected MsgHandler getMsgHandler() { | protected MsgHandler getMsgHandler() { | ||||
| return this.msgHadler; | |||||
| return this.msgHandler; | |||||
| } | } | ||||
| @Override | @Override | ||||