补全一些接口
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m9s

This commit is contained in:
2026-07-27 17:17:43 +08:00
parent 072ec1db7e
commit d46ccbd319
8 changed files with 221 additions and 43 deletions

View File

@@ -11006,6 +11006,36 @@ components:
format: date-time
type: string
type: object
DtoWeComBusinessFieldListResponse:
properties:
business_type:
description: 业务类型
type: string
business_type_name:
description: 业务类型名称(中文)
type: string
items:
description: 当前业务类型允许写入 control_mapping.business_field 的字段
items:
$ref: '#/components/schemas/DtoWeComBusinessFieldResponse'
nullable: true
type: array
type: object
DtoWeComBusinessFieldResponse:
properties:
code:
description: control_mapping.business_field 应填写的稳定字段编码
type: string
description:
description: 字段取值说明
type: string
name:
description: 字段中文名称
type: string
value_type:
description: 字段值类型 (string:字符串, integer:整数, money:两位小数的元金额字符串, file_list:对象存储文件引用列表)
type: string
type: object
DtoWeComConnectionTestResponse:
properties:
success:
@@ -11015,7 +11045,7 @@ components:
DtoWeComControlMappingItem:
properties:
business_field:
description: 稳定业务字段编码
description: 系统业务字段编码;按 business_type 调用 GET /api/admin/wecom/scenes/{business_type}/fields 获取可选值
type: string
control_id:
description: 企微模板控件 ID
@@ -28890,12 +28920,12 @@ paths:
/api/admin/wecom/scenes/{business_type}:
put:
parameters:
- description: 业务类型 (refund_approval:退款审批, offline_recharge_approval:员工线下代充值审批)
- description: 业务类型 (refund_approval:退款审批, offline_recharge_approval:员工线下代充值审批);可先调用 GET /api/admin/wecom/scenes/{business_type}/fields 查询允许映射的业务字段
in: path
name: business_type
required: true
schema:
description: 业务类型 (refund_approval:退款审批, offline_recharge_approval:员工线下代充值审批)
description: 业务类型 (refund_approval:退款审批, offline_recharge_approval:员工线下代充值审批);可先调用 GET /api/admin/wecom/scenes/{business_type}/fields 查询允许映射的业务字段
type: string
requestBody:
content:
@@ -28958,6 +28988,72 @@ paths:
summary: 保存并校验企业微信审批场景模板映射
tags:
- 企业微信审批
/api/admin/wecom/scenes/{business_type}/fields:
get:
parameters:
- description: 业务类型 (refund_approval:退款审批, offline_recharge_approval:员工线下代充值审批)
in: path
name: business_type
required: true
schema:
description: 业务类型 (refund_approval:退款审批, offline_recharge_approval:员工线下代充值审批)
type: string
responses:
"200":
content:
application/json:
schema:
properties:
code:
description: 响应码
example: 0
type: integer
data:
$ref: '#/components/schemas/DtoWeComBusinessFieldListResponse'
msg:
description: 响应消息
example: success
type: string
timestamp:
description: 时间戳
format: date-time
type: string
required:
- code
- msg
- data
- timestamp
type: object
description: 成功
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 请求参数错误
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 未认证或认证已过期
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 无权访问
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 服务器内部错误
security:
- BearerAuth: []
summary: 查询企业微信审批场景可映射字段
tags:
- 企业微信审批
/api/auth/login:
post:
requestBody:

View File

@@ -11,6 +11,7 @@
- `POST /api/admin/wecom/applications/:id/members/sync`:拉取应用可见范围内的成员并原子刷新本地选择快照。
- `GET /api/admin/wecom/applications/:id/members`:按姓名或 userid 搜索并分页选择最近同步的可见成员。
- `POST /api/admin/wecom/applications/:id/templates/inspect`:输入企微后台已知模板 ID实时读取模板名称、控件 ID、类型、必填标识和选项 key供保存映射前选择控件。
- `GET /api/admin/wecom/scenes/:business_type/fields`:返回指定业务类型允许映射的系统字段编码、中文名、值类型和取值说明。
- `PUT /api/admin/accounts/:id/wecom-binding`:把系统账号绑定到管理员明确选择的 `(corp_id, userid)`,同时保存姓名快照。
- `PUT /api/admin/wecom/scenes/:business_type`:配置已知 `template_id` 和业务字段控件映射,保存前实时读取模板详情校验。
- `GET /api/admin/wecom/scenes`:分页查询退款、员工线下代充值两个稳定业务场景的当前模板映射。
@@ -50,6 +51,7 @@
## 审批场景与模板映射
- 企微没有按应用枚举全部审批模板的接口;管理员需先从企微后台取得模板 ID再调用模板检查接口读取可映射控件。
- 前端保存映射前先查询场景字段接口,以返回的 `code` 填写 `control_mapping.business_field`;字段接口与保存校验复用同一份定义。
- 稳定业务类型固定为 `refund_approval``offline_recharge_approval`,业务代码不直接写死企微模板 ID。
- 模板必须先在企业微信后台创建;本系统不创建模板,也不保存审批节点或审批人规则。
- 保存映射时调用模板详情,逐项校验控件 ID、控件类型和选择项 key并要求模板所有必填控件都有映射模板结构已变化时拒绝覆盖当前有效配置。