mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
issue #46
This commit is contained in:
parent
08405a879d
commit
6027125025
@ -119,6 +119,8 @@ public class WxCpMessageRouter {
|
|||||||
|
|
||||||
private boolean async = true;
|
private boolean async = true;
|
||||||
|
|
||||||
|
private String fromUser;
|
||||||
|
|
||||||
private String msgType;
|
private String msgType;
|
||||||
|
|
||||||
private String event;
|
private String event;
|
||||||
@ -212,6 +214,16 @@ public class WxCpMessageRouter {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果fromUser等于某值
|
||||||
|
* @param fromUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Rule fromUser(String fromUser) {
|
||||||
|
this.fromUser = fromUser;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置微信消息拦截器
|
* 设置微信消息拦截器
|
||||||
* @param interceptor
|
* @param interceptor
|
||||||
@ -282,6 +294,8 @@ public class WxCpMessageRouter {
|
|||||||
|
|
||||||
protected boolean test(WxCpXmlMessage wxMessage) {
|
protected boolean test(WxCpXmlMessage wxMessage) {
|
||||||
return
|
return
|
||||||
|
(this.fromUser == null || this.fromUser.equals(wxMessage.getFromUserName()))
|
||||||
|
&&
|
||||||
(this.agentId == null || this.agentId.equals(wxMessage.getAgentId()))
|
(this.agentId == null || this.agentId.equals(wxMessage.getAgentId()))
|
||||||
&&
|
&&
|
||||||
(this.msgType == null || this.msgType.equals(wxMessage.getMsgType()))
|
(this.msgType == null || this.msgType.equals(wxMessage.getMsgType()))
|
||||||
|
@ -119,6 +119,8 @@ public class WxMpMessageRouter {
|
|||||||
|
|
||||||
private boolean async = true;
|
private boolean async = true;
|
||||||
|
|
||||||
|
private String fromUser;
|
||||||
|
|
||||||
private String msgType;
|
private String msgType;
|
||||||
|
|
||||||
private String event;
|
private String event;
|
||||||
@ -200,6 +202,16 @@ public class WxMpMessageRouter {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果fromUser等于某值
|
||||||
|
* @param fromUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Rule fromUser(String fromUser) {
|
||||||
|
this.fromUser = fromUser;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置微信消息拦截器
|
* 设置微信消息拦截器
|
||||||
* @param interceptor
|
* @param interceptor
|
||||||
@ -270,6 +282,8 @@ public class WxMpMessageRouter {
|
|||||||
|
|
||||||
protected boolean test(WxMpXmlMessage wxMessage) {
|
protected boolean test(WxMpXmlMessage wxMessage) {
|
||||||
return
|
return
|
||||||
|
(this.fromUser == null || this.fromUser.equals(wxMessage.getFromUserName()))
|
||||||
|
&&
|
||||||
(this.msgType == null || this.msgType.equals(wxMessage.getMsgType()))
|
(this.msgType == null || this.msgType.equals(wxMessage.getMsgType()))
|
||||||
&&
|
&&
|
||||||
(this.event == null || this.event.equals(wxMessage.getEvent()))
|
(this.event == null || this.event.equals(wxMessage.getEvent()))
|
||||||
|
Loading…
Reference in New Issue
Block a user