You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
788 B
27 lines
788 B
2 years ago
|
package com.ynxbd.common.config.interceptor;
|
||
|
|
||
|
import com.soecode.wxtools.api.IService;
|
||
|
import com.soecode.wxtools.api.WxConsts;
|
||
|
import com.soecode.wxtools.api.WxMessageInterceptor;
|
||
|
import com.soecode.wxtools.bean.WxXmlMessage;
|
||
|
import com.soecode.wxtools.exception.WxErrorException;
|
||
|
|
||
|
import java.util.Map;
|
||
|
|
||
|
/**
|
||
|
* 示例:拦截器
|
||
|
* 目的:拦截非TEXT类型的所有消息
|
||
|
*
|
||
|
* @author antgan
|
||
|
* @date 2016/12/15
|
||
|
*/
|
||
|
public class DemoInterceptor implements WxMessageInterceptor {
|
||
|
|
||
|
@Override
|
||
|
public boolean intercept(WxXmlMessage wxMessage, Map<String, Object> context, IService iService)
|
||
|
throws WxErrorException {
|
||
|
//拦截所有非TEXT类型的消息,true通行;false拦截
|
||
|
return WxConsts.XML_MSG_TEXT.equals(wxMessage.getMsgType());
|
||
|
}
|
||
|
}
|