public class WxCpMessageRouterRule
extends java.lang.Object
限定符 | 构造器和说明 |
---|---|
protected |
WxCpMessageRouterRule(WxCpMessageRouter routerBuilder)
Instantiates a new Wx cp message router rule.
|
限定符和类型 | 方法和说明 |
---|---|
WxCpMessageRouterRule |
agentId(java.lang.Integer agentId)
如果agentId匹配
|
WxCpMessageRouterRule |
async(boolean async)
设置是否异步执行,默认是true
|
WxCpMessageRouterRule |
content(java.lang.String content)
如果content等于某值
|
WxCpMessageRouter |
end()
规则结束,代表如果一个消息匹配该规则,那么它将不再会进入其他规则
|
WxCpMessageRouterRule |
event(java.lang.String event)
如果event等于某值
|
WxCpMessageRouterRule |
eventKey(java.lang.String eventKey)
如果eventKey等于某值
|
WxCpMessageRouterRule |
eventKeyRegex(java.lang.String regex)
如果eventKey匹配该正则表达式
|
WxCpMessageRouterRule |
fromUser(java.lang.String fromUser)
如果fromUser等于某值
|
WxCpMessageRouterRule |
handler(WxCpMessageHandler handler)
设置微信消息处理器
|
WxCpMessageRouterRule |
handler(WxCpMessageHandler handler,
WxCpMessageHandler... otherHandlers)
设置微信消息处理器
|
WxCpMessageRouterRule |
interceptor(WxCpMessageInterceptor interceptor)
设置微信消息拦截器
|
WxCpMessageRouterRule |
interceptor(WxCpMessageInterceptor interceptor,
WxCpMessageInterceptor... otherInterceptors)
设置微信消息拦截器
|
WxCpMessageRouterRule |
matcher(WxCpMessageMatcher matcher)
如果消息匹配某个matcher,用在用户需要自定义更复杂的匹配规则的时候
|
WxCpMessageRouterRule |
msgType(java.lang.String msgType)
如果msgType等于某值
|
WxCpMessageRouter |
next()
规则结束,但是消息还会进入其他规则
|
WxCpMessageRouterRule |
rContent(java.lang.String regex)
如果content匹配该正则表达式
|
protected WxCpXmlOutMessage |
service(WxCpXmlMessage wxMessage,
java.util.Map<java.lang.String,java.lang.Object> context,
WxCpService wxCpService,
me.chanjar.weixin.common.session.WxSessionManager sessionManager,
me.chanjar.weixin.common.api.WxErrorExceptionHandler exceptionHandler)
处理微信推送过来的消息
|
protected boolean |
test(WxCpXmlMessage wxMessage)
Test boolean.
|
protected WxCpMessageRouterRule(WxCpMessageRouter routerBuilder)
routerBuilder
- the router builderpublic WxCpMessageRouterRule async(boolean async)
async
- the asyncpublic WxCpMessageRouterRule agentId(java.lang.Integer agentId)
agentId
- the agent idpublic WxCpMessageRouterRule msgType(java.lang.String msgType)
msgType
- the msg typepublic WxCpMessageRouterRule event(java.lang.String event)
event
- the eventpublic WxCpMessageRouterRule eventKey(java.lang.String eventKey)
eventKey
- the event keypublic WxCpMessageRouterRule eventKeyRegex(java.lang.String regex)
regex
- the regexpublic WxCpMessageRouterRule content(java.lang.String content)
content
- the contentpublic WxCpMessageRouterRule rContent(java.lang.String regex)
regex
- the regexpublic WxCpMessageRouterRule fromUser(java.lang.String fromUser)
fromUser
- the from userpublic WxCpMessageRouterRule matcher(WxCpMessageMatcher matcher)
matcher
- the matcherpublic WxCpMessageRouterRule interceptor(WxCpMessageInterceptor interceptor)
interceptor
- the interceptorpublic WxCpMessageRouterRule interceptor(WxCpMessageInterceptor interceptor, WxCpMessageInterceptor... otherInterceptors)
interceptor
- the interceptorotherInterceptors
- the other interceptorspublic WxCpMessageRouterRule handler(WxCpMessageHandler handler)
handler
- the handlerpublic WxCpMessageRouterRule handler(WxCpMessageHandler handler, WxCpMessageHandler... otherHandlers)
handler
- the handlerotherHandlers
- the other handlerspublic WxCpMessageRouter end()
public WxCpMessageRouter next()
protected boolean test(WxCpXmlMessage wxMessage)
wxMessage
- the wx messageprotected WxCpXmlOutMessage service(WxCpXmlMessage wxMessage, java.util.Map<java.lang.String,java.lang.Object> context, WxCpService wxCpService, me.chanjar.weixin.common.session.WxSessionManager sessionManager, me.chanjar.weixin.common.api.WxErrorExceptionHandler exceptionHandler)
wxMessage
- the wx messagecontext
- the contextwxCpService
- the wx cp servicesessionManager
- the session managerexceptionHandler
- the exception handler