Skip to content

feat(channels): 支持微信客服接收图片和文件 - #204

Closed
orhuoxu wants to merge 13 commits into
OpenBMB:mainfrom
orhuoxu:wechat-wecom-attachment
Closed

feat(channels): 支持微信客服接收图片和文件#204
orhuoxu wants to merge 13 commits into
OpenBMB:mainfrom
orhuoxu:wechat-wecom-attachment

Conversation

@orhuoxu

@orhuoxu orhuoxu commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

变更说明

支持微信客服渠道接收客户发送的图片和文件,并复用现有附件处理与存储链路。

主要改动

  • 支持微信客服 image、file、mixed 消息归一化。
  • 通过企业微信 media/get 接口流式下载媒体。
  • 增加图片 2 MB、文件 20 MB 的渠道限制。
  • 正确处理媒体下载接口返回的 JSON 错误。
  • 修复 durable inbox 重放时附件类型恢复。
  • 增加图片、文件、混合消息、重放和下载错误测试。

验证

  • backend/.venv/bin/python -m pytest backend/tests/test_wechat_kf_callback.py backend/tests/test_channel_wechat.py
  • backend/.venv/bin/ruff check backend/app/channels/adapters/wechat_kf.py backend/app/channels/service_wechat_kf_inbox.py backend/tests/test_wechat_kf_callback.py
  • git diff --check

测试结果:61 passed,Ruff 检查通过。

风险与注意事项

  • 本 PR 只支持客户发给微信客服的入站图片和文件,暂不涉及客服出站媒体消息。
  • 微信客服应用需要具备对应的消息收发权限。

@orhuoxu

orhuoxu commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

已将后续微信客服图片和文件支持追加到 PR #203,本 PR 关闭以避免重复。

@orhuoxu orhuoxu closed this Aug 21, 2026
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.

2 participants