example-scan
This commit is contained in:
+3
@@ -1,5 +1,7 @@
|
||||
package com.foximy.weixin4j.example.server.handler;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||
import com.foxinmy.weixin4j.message.TextMessage;
|
||||
@@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
||||
* @since JDK 1.7
|
||||
* @see
|
||||
*/
|
||||
@Component
|
||||
public class HelloMessageHandler extends MessageHandlerAdapter<TextMessage> {
|
||||
@Override
|
||||
public boolean canHandle0(WeixinRequest request, TextMessage message)
|
||||
|
||||
+3
@@ -1,5 +1,7 @@
|
||||
package com.foximy.weixin4j.example.server.handler;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||
import com.foxinmy.weixin4j.mp.event.ScribeEventMessage;
|
||||
@@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
||||
* @since JDK 1.7
|
||||
* @see
|
||||
*/
|
||||
@Component
|
||||
public class SubscribeMessageHandler extends
|
||||
MessageHandlerAdapter<ScribeEventMessage> {
|
||||
|
||||
|
||||
+3
@@ -1,5 +1,7 @@
|
||||
package com.foximy.weixin4j.example.server.handler;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||
import com.foxinmy.weixin4j.message.TextMessage;
|
||||
@@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
||||
* @since JDK 1.7
|
||||
* @see
|
||||
*/
|
||||
@Component
|
||||
public class TextMessageHandler extends MessageHandlerAdapter<TextMessage> {
|
||||
|
||||
@Override
|
||||
|
||||
+3
@@ -1,5 +1,7 @@
|
||||
package com.foximy.weixin4j.example.server.handler;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||
import com.foxinmy.weixin4j.message.VoiceMessage;
|
||||
@@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
||||
* @since JDK 1.7
|
||||
* @see
|
||||
*/
|
||||
@Component
|
||||
public class VoiceMessageHandler extends MessageHandlerAdapter<VoiceMessage> {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
|
||||
|
||||
<!-- 微信接口代理~start -->
|
||||
@@ -99,4 +96,8 @@
|
||||
value="com.foximy.weixin4j.example.server.handler" />
|
||||
</bean>
|
||||
<!-- 微信消息服务~end -->
|
||||
|
||||
<!-- spring扫描策略~start -->
|
||||
<context:component-scan base-package="com.foximy.weixin4j.example.server.handler" />
|
||||
<!-- spring扫描策略~end -->
|
||||
</beans>
|
||||
Reference in New Issue
Block a user