example-scan
This commit is contained in:
parent
525246212b
commit
ed0c7161cf
@ -3,3 +3,5 @@
|
|||||||
* CouponApi `优惠券API`
|
* CouponApi `优惠券API`
|
||||||
|
|
||||||
* PayApi `微信支付API`
|
* PayApi `微信支付API`
|
||||||
|
|
||||||
|
* CustomsApi `报关接口`
|
||||||
@ -2,6 +2,7 @@ package com.foxinmy.weixin4j.model;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
@ -61,7 +62,20 @@ public class Button implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个菜单
|
* 创建一个菜单(一级菜单)
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* 菜单显示的名称
|
||||||
|
* @param subButtons
|
||||||
|
* 二级菜单
|
||||||
|
*/
|
||||||
|
public Button(String name, Button... subButtons) {
|
||||||
|
this.name = name;
|
||||||
|
this.subs = Arrays.asList(subButtons);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建一个菜单(二级菜单)
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* 菜单显示的名称
|
* 菜单显示的名称
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public class PayTest {
|
|||||||
protected final static WeixinPayProxy PAY;
|
protected final static WeixinPayProxy PAY;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
ACCOUNT = new WeixinPayAccount("wx4ab8f8de58159a57", "GATFzDwbQdbbci3QEQxX2rUBvwTrsMiZ", "1290664601");
|
ACCOUNT = new WeixinPayAccount("appid", "paysignkey", "mchid");
|
||||||
SIGNATURE = new WeixinPaymentSignature(ACCOUNT.getPaySignKey());
|
SIGNATURE = new WeixinPaymentSignature(ACCOUNT.getPaySignKey());
|
||||||
PAY = new WeixinPayProxy(new Weixin4jSettings(ACCOUNT));
|
PAY = new WeixinPayProxy(new Weixin4jSettings(ACCOUNT));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foximy.weixin4j.example.server.handler;
|
package com.foximy.weixin4j.example.server.handler;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||||
import com.foxinmy.weixin4j.message.TextMessage;
|
import com.foxinmy.weixin4j.message.TextMessage;
|
||||||
@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class HelloMessageHandler extends MessageHandlerAdapter<TextMessage> {
|
public class HelloMessageHandler extends MessageHandlerAdapter<TextMessage> {
|
||||||
@Override
|
@Override
|
||||||
public boolean canHandle0(WeixinRequest request, TextMessage message)
|
public boolean canHandle0(WeixinRequest request, TextMessage message)
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foximy.weixin4j.example.server.handler;
|
package com.foximy.weixin4j.example.server.handler;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||||
import com.foxinmy.weixin4j.mp.event.ScribeEventMessage;
|
import com.foxinmy.weixin4j.mp.event.ScribeEventMessage;
|
||||||
@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class SubscribeMessageHandler extends
|
public class SubscribeMessageHandler extends
|
||||||
MessageHandlerAdapter<ScribeEventMessage> {
|
MessageHandlerAdapter<ScribeEventMessage> {
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foximy.weixin4j.example.server.handler;
|
package com.foximy.weixin4j.example.server.handler;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||||
import com.foxinmy.weixin4j.message.TextMessage;
|
import com.foxinmy.weixin4j.message.TextMessage;
|
||||||
@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class TextMessageHandler extends MessageHandlerAdapter<TextMessage> {
|
public class TextMessageHandler extends MessageHandlerAdapter<TextMessage> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.foximy.weixin4j.example.server.handler;
|
package com.foximy.weixin4j.example.server.handler;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
|
||||||
import com.foxinmy.weixin4j.message.VoiceMessage;
|
import com.foxinmy.weixin4j.message.VoiceMessage;
|
||||||
@ -16,6 +18,7 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class VoiceMessageHandler extends MessageHandlerAdapter<VoiceMessage> {
|
public class VoiceMessageHandler extends MessageHandlerAdapter<VoiceMessage> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -1,12 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||||
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
|
|
||||||
xsi:schemaLocation="
|
xsi:schemaLocation="
|
||||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
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">
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
|
||||||
|
|
||||||
<!-- 微信接口代理~start -->
|
<!-- 微信接口代理~start -->
|
||||||
@ -99,4 +96,8 @@
|
|||||||
value="com.foximy.weixin4j.example.server.handler" />
|
value="com.foximy.weixin4j.example.server.handler" />
|
||||||
</bean>
|
</bean>
|
||||||
<!-- 微信消息服务~end -->
|
<!-- 微信消息服务~end -->
|
||||||
|
|
||||||
|
<!-- spring扫描策略~start -->
|
||||||
|
<context:component-scan base-package="com.foximy.weixin4j.example.server.handler" />
|
||||||
|
<!-- spring扫描策略~end -->
|
||||||
</beans>
|
</beans>
|
||||||
Loading…
x
Reference in New Issue
Block a user