🎨 #1909 【企业微信】第三方应用路由规则类增加msgType和event的支持

This commit is contained in:
ParkerJX 2020-12-24 15:13:47 +08:00 committed by GitHub
parent cbcba481b0
commit 55e1399fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,6 +74,28 @@ public class WxCpTpMessageRouterRule {
return this;
}
/**
* 如果msgType等于某值
*
* @param msgType the msg type
* @return the wx cp tp message router rule
*/
public WxCpTpMessageRouterRule msgType(String msgType) {
this.msgType = msgType;
return this;
}
/**
* 如果event等于某值
*
* @param event the event
* @return the wx cp tp message router rule
*/
public WxCpTpMessageRouterRule event(String event) {
this.event = event;
return this;
}
/**
* 匹配 Message infoType
*
@ -192,6 +214,8 @@ public class WxCpTpMessageRouterRule {
&&
(this.msgType == null || this.msgType.equalsIgnoreCase(wxMessage.getMsgType()))
&&
(this.event == null || this.event.equalsIgnoreCase(wxMessage.getEvent()))
&&
(this.infoType == null || this.infoType.equals(wxMessage.getInfoType()))
&&
(this.suiteTicket == null || this.suiteTicket.equalsIgnoreCase(wxMessage.getSuiteTicket()))