From b8ce6a699c0266051fb06eee7ccf226380948fed Mon Sep 17 00:00:00 2001 From: YS-zdck Date: Fri, 26 Jun 2026 15:35:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(im):=20=E6=96=B0=E5=A2=9EQQBot=E5=8D=B3?= =?UTF-8?q?=E6=97=B6=E9=80=9A=E8=AE=AF=E5=B9=B3=E5=8F=B0=E9=9B=86=E6=88=90?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完整实现QQBot的IM适配器功能,包括客户端封装、WebSocket长连接管理、消息收发与事件解析;更新后端合法平台校验列表与适配器注册配置;补充前端平台选型选项、logo资源、多语言文案以及渠道配置表单,同时添加对应的单元测试。 --- frontend/src/api/agent/index.ts | 2 +- frontend/src/assets/img/im/qqbot.svg | 1 + frontend/src/components/IMChannelPanel.vue | 34 +++- frontend/src/components/menu.vue | 2 + frontend/src/i18n/locales/en-US.ts | 6 +- frontend/src/i18n/locales/ko-KR.ts | 6 +- frontend/src/i18n/locales/ru-RU.ts | 6 +- frontend/src/i18n/locales/zh-CN.ts | 6 +- internal/container/container.go | 2 + internal/handler/im.go | 4 +- internal/im/adapter.go | 1 + internal/im/qqbot/adapter.go | 127 +++++++++++++ internal/im/qqbot/adapter_test.go | 78 ++++++++ internal/im/qqbot/client.go | 169 ++++++++++++++++++ internal/im/qqbot/factory.go | 47 +++++ internal/im/qqbot/longconn.go | 196 +++++++++++++++++++++ internal/im/qqbot/types.go | 83 +++++++++ internal/im/types.go | 4 + 18 files changed, 766 insertions(+), 8 deletions(-) create mode 100644 frontend/src/assets/img/im/qqbot.svg create mode 100644 internal/im/qqbot/adapter.go create mode 100644 internal/im/qqbot/adapter_test.go create mode 100644 internal/im/qqbot/client.go create mode 100644 internal/im/qqbot/factory.go create mode 100644 internal/im/qqbot/longconn.go create mode 100644 internal/im/qqbot/types.go diff --git a/frontend/src/api/agent/index.ts b/frontend/src/api/agent/index.ts index f49a33e3..2336a8f4 100644 --- a/frontend/src/api/agent/index.ts +++ b/frontend/src/api/agent/index.ts @@ -259,7 +259,7 @@ export interface IMChannel { id: string; tenant_id?: number; agent_id: string; - platform: 'wecom' | 'feishu' | 'slack' | 'telegram' | 'dingtalk' | 'mattermost' | 'wechat'; + platform: 'wecom' | 'feishu' | 'slack' | 'telegram' | 'dingtalk' | 'mattermost' | 'wechat' | 'qqbot'; name: string; enabled: boolean; mode: 'webhook' | 'websocket' | 'longpoll'; diff --git a/frontend/src/assets/img/im/qqbot.svg b/frontend/src/assets/img/im/qqbot.svg new file mode 100644 index 00000000..26c08d80 --- /dev/null +++ b/frontend/src/assets/img/im/qqbot.svg @@ -0,0 +1 @@ + diff --git a/frontend/src/components/IMChannelPanel.vue b/frontend/src/components/IMChannelPanel.vue index aa2ea321..9321505a 100644 --- a/frontend/src/components/IMChannelPanel.vue +++ b/frontend/src/components/IMChannelPanel.vue @@ -492,6 +492,35 @@ + + +