mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-11-01 03:25:35 +08:00 
			
		
		
		
	完善Demo,保证其中一个公众号可以正常使用,close #7
This commit is contained in:
		| @ -0,0 +1,23 @@ | |||||||
|  | package com.github.binarywang.demo.spring.handler.gzh1; | ||||||
|  |  | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||||||
|  | import org.springframework.context.annotation.Scope; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  |  | ||||||
|  | import com.github.binarywang.demo.spring.config.WxConfig; | ||||||
|  | import com.github.binarywang.demo.spring.config.WxGzh1Config; | ||||||
|  | import com.github.binarywang.demo.spring.handler.LocationHandler; | ||||||
|  |  | ||||||
|  | @Component | ||||||
|  | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||||
|  | public class Gzh1LocationHandler extends LocationHandler { | ||||||
|  |   @Autowired | ||||||
|  |   private  WxGzh1Config wxConfig; | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   protected WxConfig getWxConfig() { | ||||||
|  |     return this.wxConfig; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | package com.github.binarywang.demo.spring.handler.gzh1; | ||||||
|  |  | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||||||
|  | import org.springframework.context.annotation.Scope; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  |  | ||||||
|  | import com.github.binarywang.demo.spring.config.WxConfig; | ||||||
|  | import com.github.binarywang.demo.spring.config.WxGzh1Config; | ||||||
|  | import com.github.binarywang.demo.spring.handler.MenuHandler; | ||||||
|  |  | ||||||
|  | @Component | ||||||
|  | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||||
|  | public class Gzh1MenuHadler extends MenuHandler { | ||||||
|  |   @Autowired | ||||||
|  |   private  WxGzh1Config wxConfig; | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   protected WxConfig getWxConfig() { | ||||||
|  |     return this.wxConfig; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | package com.github.binarywang.demo.spring.handler.gzh1; | ||||||
|  |  | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||||||
|  | import org.springframework.context.annotation.Scope; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  |  | ||||||
|  | import com.github.binarywang.demo.spring.config.WxConfig; | ||||||
|  | import com.github.binarywang.demo.spring.config.WxGzh1Config; | ||||||
|  | import com.github.binarywang.demo.spring.handler.MsgHandler; | ||||||
|  |  | ||||||
|  | @Component | ||||||
|  | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||||
|  | public class Gzh1MsgHadler extends MsgHandler { | ||||||
|  |   @Autowired | ||||||
|  |   private  WxGzh1Config wxConfig; | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   protected WxConfig getWxConfig() { | ||||||
|  |     return this.wxConfig; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | package com.github.binarywang.demo.spring.handler.gzh1; | ||||||
|  |  | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||||||
|  | import org.springframework.context.annotation.Scope; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  |  | ||||||
|  | import com.github.binarywang.demo.spring.config.WxConfig; | ||||||
|  | import com.github.binarywang.demo.spring.config.WxGzh1Config; | ||||||
|  | import com.github.binarywang.demo.spring.handler.SubscribeHandler; | ||||||
|  |  | ||||||
|  | import me.chanjar.weixin.mp.bean.WxMpXmlMessage; | ||||||
|  | import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage; | ||||||
|  |  | ||||||
|  | @Component | ||||||
|  | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||||
|  | public class Gzh1SubscribeHadler extends SubscribeHandler { | ||||||
|  |   @Autowired | ||||||
|  |   private  WxGzh1Config wxConfig; | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   protected WxConfig getWxConfig() { | ||||||
|  |     return this.wxConfig; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   protected WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage) | ||||||
|  |       throws Exception { | ||||||
|  |     return null; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | package com.github.binarywang.demo.spring.handler.gzh1; | ||||||
|  |  | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||||||
|  | import org.springframework.context.annotation.Scope; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  |  | ||||||
|  | import com.github.binarywang.demo.spring.config.WxConfig; | ||||||
|  | import com.github.binarywang.demo.spring.config.WxGzh1Config; | ||||||
|  | import com.github.binarywang.demo.spring.handler.UnsubscribeHandler; | ||||||
|  |  | ||||||
|  | @Component | ||||||
|  | @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | ||||||
|  | public class Gzh1UnSubscribeHadler extends UnsubscribeHandler { | ||||||
|  |   @Autowired | ||||||
|  |   private  WxGzh1Config wxConfig; | ||||||
|  |  | ||||||
|  |   @Override | ||||||
|  |   protected WxConfig getWxConfig() { | ||||||
|  |     return this.wxConfig; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -10,6 +10,11 @@ import com.github.binarywang.demo.spring.handler.MenuHandler; | |||||||
| import com.github.binarywang.demo.spring.handler.MsgHandler; | 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.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; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  *  |  *  | ||||||
| @ -19,8 +24,23 @@ import com.github.binarywang.demo.spring.handler.UnsubscribeHandler; | |||||||
| @Service | @Service | ||||||
| public class Gzh1WxService extends BaseWxService { | public class Gzh1WxService extends BaseWxService { | ||||||
|   @Autowired |   @Autowired | ||||||
|   private  WxGzh1Config wxConfig; |   private WxGzh1Config wxConfig; | ||||||
|  |  | ||||||
|  |   @Autowired | ||||||
|  |   private Gzh1LocationHandler locationHandler; | ||||||
|    |    | ||||||
|  |   @Autowired | ||||||
|  |   private Gzh1MenuHadler menuHadler; | ||||||
|  |    | ||||||
|  |   @Autowired | ||||||
|  |   private Gzh1MsgHadler msgHadler; | ||||||
|  |    | ||||||
|  |   @Autowired | ||||||
|  |   private Gzh1UnSubscribeHadler unSubscribeHadler; | ||||||
|  |    | ||||||
|  |   @Autowired | ||||||
|  |   private Gzh1SubscribeHadler subscribeHadler; | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   protected WxConfig getServerConfig() { |   protected WxConfig getServerConfig() { | ||||||
|     return this.wxConfig; |     return this.wxConfig; | ||||||
| @ -28,37 +48,31 @@ public class Gzh1WxService extends BaseWxService { | |||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   protected MenuHandler getMenuHandler() { |   protected MenuHandler getMenuHandler() { | ||||||
|     // TODO Auto-generated method stub |     return this.menuHadler; | ||||||
|     return null; |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   protected SubscribeHandler getSubscribeHandler() { |   protected SubscribeHandler getSubscribeHandler() { | ||||||
|     // TODO Auto-generated method stub |     return this.subscribeHadler; | ||||||
|     return null; |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   protected UnsubscribeHandler getUnsubscribeHandler() { |   protected UnsubscribeHandler getUnsubscribeHandler() { | ||||||
|     // TODO Auto-generated method stub |     return this.unSubscribeHadler; | ||||||
|     return null; |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   protected AbstractHandler getLocationHandler() { |   protected AbstractHandler getLocationHandler() { | ||||||
|     // TODO Auto-generated method stub |     return this.locationHandler; | ||||||
|     return null; |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   protected MsgHandler getMsgHandler() { |   protected MsgHandler getMsgHandler() { | ||||||
|     // TODO Auto-generated method stub |     return this.msgHadler; | ||||||
|     return null; |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Override |   @Override | ||||||
|   protected AbstractHandler getScanHandler() { |   protected AbstractHandler getScanHandler() { | ||||||
|     // TODO Auto-generated method stub |  | ||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 BinaryWang
					BinaryWang