mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat(channel): add WeChat (weixin) adapter with QR code (#278)
* feat(channel): add WeChat (weixin) adapter with QR code * fix(channel): fix weixin block streaming * chore(channel): update weixin logo
This commit is contained in:
+156
@@ -4949,6 +4949,111 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{id}/channel/weixin/qr/poll": {
|
||||
"post": {
|
||||
"description": "Long-poll the QR code scan status. On confirmed, auto-saves credentials.",
|
||||
"tags": [
|
||||
"bots"
|
||||
],
|
||||
"summary": "Poll WeChat QR login status",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Bot ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "QR code to poll",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRPollRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRPollResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{id}/channel/weixin/qr/start": {
|
||||
"post": {
|
||||
"description": "Fetch a QR code from WeChat for scanning",
|
||||
"tags": [
|
||||
"bots"
|
||||
],
|
||||
"summary": "Start WeChat QR login",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Bot ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Optional base URL override",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRStartRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRStartResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{id}/channel/{platform}": {
|
||||
"get": {
|
||||
"description": "Get bot channel configuration",
|
||||
@@ -12398,6 +12503,57 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRPollRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"qr_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"routeTag": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRPollResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "wait, scaned, confirmed, expired",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRStartRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"routeTag": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRStartResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"qr_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"qr_code_url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
@@ -4940,6 +4940,111 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{id}/channel/weixin/qr/poll": {
|
||||
"post": {
|
||||
"description": "Long-poll the QR code scan status. On confirmed, auto-saves credentials.",
|
||||
"tags": [
|
||||
"bots"
|
||||
],
|
||||
"summary": "Poll WeChat QR login status",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Bot ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "QR code to poll",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRPollRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRPollResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{id}/channel/weixin/qr/start": {
|
||||
"post": {
|
||||
"description": "Fetch a QR code from WeChat for scanning",
|
||||
"tags": [
|
||||
"bots"
|
||||
],
|
||||
"summary": "Start WeChat QR login",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Bot ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Optional base URL override",
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRStartRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/weixin.QRStartResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{id}/channel/{platform}": {
|
||||
"get": {
|
||||
"description": "Get bot channel configuration",
|
||||
@@ -12389,6 +12494,57 @@
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRPollRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"qr_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"routeTag": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRPollResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "wait, scaned, confirmed, expired",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRStartRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"routeTag": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"weixin.QRStartResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"qr_code": {
|
||||
"type": "string"
|
||||
},
|
||||
"qr_code_url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2531,6 +2531,39 @@ definitions:
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
weixin.QRPollRequest:
|
||||
properties:
|
||||
baseUrl:
|
||||
type: string
|
||||
qr_code:
|
||||
type: string
|
||||
routeTag:
|
||||
type: string
|
||||
type: object
|
||||
weixin.QRPollResponse:
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
status:
|
||||
description: wait, scaned, confirmed, expired
|
||||
type: string
|
||||
type: object
|
||||
weixin.QRStartRequest:
|
||||
properties:
|
||||
baseUrl:
|
||||
type: string
|
||||
routeTag:
|
||||
type: string
|
||||
type: object
|
||||
weixin.QRStartResponse:
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
qr_code:
|
||||
type: string
|
||||
qr_code_url:
|
||||
type: string
|
||||
type: object
|
||||
info:
|
||||
contact: {}
|
||||
title: Memoh API
|
||||
@@ -6072,6 +6105,75 @@ paths:
|
||||
summary: Update bot channel status
|
||||
tags:
|
||||
- bots
|
||||
/bots/{id}/channel/weixin/qr/poll:
|
||||
post:
|
||||
description: Long-poll the QR code scan status. On confirmed, auto-saves credentials.
|
||||
parameters:
|
||||
- description: Bot ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: QR code to poll
|
||||
in: body
|
||||
name: payload
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/weixin.QRPollRequest'
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/weixin.QRPollResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
summary: Poll WeChat QR login status
|
||||
tags:
|
||||
- bots
|
||||
/bots/{id}/channel/weixin/qr/start:
|
||||
post:
|
||||
description: Fetch a QR code from WeChat for scanning
|
||||
parameters:
|
||||
- description: Bot ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Optional base URL override
|
||||
in: body
|
||||
name: payload
|
||||
schema:
|
||||
$ref: '#/definitions/weixin.QRStartRequest'
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/weixin.QRStartResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
summary: Start WeChat QR login
|
||||
tags:
|
||||
- bots
|
||||
/bots/{id}/checks:
|
||||
get:
|
||||
description: Evaluate bot attached resource checks in runtime
|
||||
|
||||
Reference in New Issue
Block a user