GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 企业微信服务商模式,消息接收路由规则无法使用msgType等方法 · Issue #1909 · binarywang/WxJava

企业微信服务商模式,消息接收路由规则无法使用msgType等方法 #1909

New issue
Copy link
New issue
Copy link
Closed
Closed
企业微信服务商模式,消息接收路由规则无法使用msgType等方法#1909
Copy link
Milestone
4.0.2

Description

@ezsky
ezsky
opened on Dec 7, 2020
Issue body actions

简要描述

无法使用这几个方法,看源码里面也去掉了,这种情况是怎么做条件筛选的。
.msgType("MSG_TYPE").event("EVENT").eventKey("EVENT_KEY").content("CONTENT")

模块版本情况

  • WxJava 模块名: cp
  • WxJava 版本号:4.0.0

详细描述

类 WxCpTpMessageRouter

java.lang.Object
me.chanjar.weixin.cp.tp.message.WxCpTpMessageRouter

public class WxCpTpMessageRouter
extends Object
微信消息路由器,通过代码化的配置,把来自微信的消息交给handler处理
和WxCpMessageRouter的rule相比,多了infoType和changeType维度的匹配

说明:

  1. 配置路由规则时要按照从细到粗的原则,否则可能消息可能会被提前处理
  2. 默认情况下消息只会被处理一次,除非使用 WxCpTpMessageRouterRule.next()
  3. 规则的结束必须用WxCpTpMessageRouterRule.end()或者WxCpTpMessageRouterRule.next(),否则不会生效

使用方法:
WxCpTpMessageRouter router = new WxCpTpMessageRouter();
router
.rule()
.msgType("MSG_TYPE").event("EVENT").eventKey("EVENT_KEY").content("CONTENT")
.interceptor(interceptor, ...).handler(handler, ...)
.end()
.rule()
.infoType("INFO_TYPE").changeType("CHANGE_TYPE")
// 另外一个匹配规则
.end()
;

// 将WxXmlMessage交给消息路由器
router.route(message);

Activity

  1. Gyv12345 commented on Dec 24, 2020

    @Gyv12345
    Gyv12345
    on Dec 24, 2020
    More actions

    配置路由规则时要按照从细到粗的原则,否则可能消息可能会被提前处理 这句话很重要

  2. binarywang
    added a commit that references this issue on Dec 24, 2020

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

    55e1399
  3. binarywang
    added this to the 4.0.2 milestone on Dec 24, 2020
  4. binarywang
    closed this as completedon Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      • 4.0.2

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.