Skip to content

补充 WxCpKfEventMsg 的 rejectSwitch 字段映射 - #4131

Open
binarywang with Copilot wants to merge 2 commits into
developfrom
copilot/add-reject-switch-attribute
Open

binarywang with Copilot wants to merge 2 commits into
developfrom
copilot/add-reject-switch-attribute

Conversation

Copilot AI commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

WxCpKfEventMsg 缺少企业微信客服“拒收客户消息变更事件”中的 reject_switch 字段,导致该事件无法完整反序列化。此 PR 补齐事件模型字段,并增加对应回归用例以覆盖该事件载荷。

  • 事件模型补齐

    • 在 WxCpKfEventMsg 中新增 rejectSwitch 属性
    • 使用 @SerializedName("reject_switch") 绑定企业微信返回字段
    • 保持现有事件模型结构不变,仅补充缺失字段映射
  • 回归覆盖

    • 为 WxCpKfMsgListResp.fromJson(...) 增加客服事件 JSON 解析用例
    • 覆盖 reject_customer_msg_switch_change 事件场景
    • 校验 eventType、servicerUserId 和 rejectSwitch 的解析结果
  • 示例

    @SerializedName("reject_switch")
    private Integer rejectSwitch;

    对应事件载荷示例:

    {
      "msgtype": "event",
      "event": {
        "event_type": "reject_customer_msg_switch_change",
        "servicer_userid": "Zhangsan",
        "open_kfid": "wkxxx",
        "external_userid": "wmxxx",
        "reject_switch": 1
      }
    }

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add rejectSwitch attribute to WxCpKfEventMsg 补充 WxCpKfEventMsg 的 rejectSwitch 字段映射 Sep 26, 2026
Copilot AI requested a review from binarywang September 26, 2026 07:18
@binarywang
binarywang marked this pull request as ready for review September 26, 2026 08:45
Copilot AI lite review requested due to automatic review settings September 26, 2026 08:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T08:47:19.717000Z 5342434 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Adds the rejectSwitch mapping for WeCom customer-service events and regression coverage for JSON deserialization.

Changes:

  • Maps reject_switch to rejectSwitch.
  • Adds assertions for the rejection-switch change event.
File Description
weixin-java-cp/​src/​test/​java/​me/​chanjar/​weixin/​cp/​bean/​kf/​WxCpKfKnowledgeTest.java Adds event parsing regression coverage
weixin-java-cp/​src/​main/​java/​me/​chanjar/​weixin/​cp/​bean/​kf/​msg/​WxCpKfEventMsg.java Adds the rejectSwitch field mapping

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@augmentcode

augmentcode Bot commented Sep 26, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

总结:此 PR 为企业微信客服事件模型补充 reject_switch 到 rejectSwitch 的 Gson 映射。
测试:新增 reject_customer_msg_switch_change 消息列表载荷的反序列化回归用例,验证事件类型、接待人员和开关值。

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WxCpKfEventMsg 缺少属性 rejectSwitch

3 participants