feat: 更新 API 响应结构,统一使用 statusCode 和 errMsg 替代 code 和 msg;新增用户类型和公司 ID 字段;优化数据库索引;添加公司所有者同步测试脚本
This commit is contained in:
@@ -241,7 +241,7 @@ paths:
|
||||
- 其他原生操作中,`update/delete/view` 仅管理员或管理后台用户允许
|
||||
|
||||
注意:
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ code, msg, data }` 包装
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ statusCode, errMsg, data }` 包装
|
||||
- `company_id` 由数据库自动生成,客户端创建时不需要传
|
||||
- `company_id` 仍带唯一索引,可用于后续按业务 id 查询
|
||||
requestBody:
|
||||
@@ -320,7 +320,7 @@ paths:
|
||||
- 按需传 `page`、`perPage`
|
||||
|
||||
注意:
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ code, msg, data }` 包装
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ statusCode, errMsg, data }` 包装
|
||||
- PocketBase 原生标准接口里,“按 `company_id` 查询单条”和“查询整个列表”共用同一个 `GET /records` 路径,因此文档以同一个 GET operation 展示两种调用模式
|
||||
parameters:
|
||||
- name: filter
|
||||
@@ -539,7 +539,7 @@ paths:
|
||||
- `page=1`
|
||||
|
||||
注意:
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ code, msg, data }` 包装
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ statusCode, errMsg, data }` 包装
|
||||
- `attachments_link` 返回的是 PocketBase 文件字段值,不是完整下载地址
|
||||
- 若需文件流地址,可按 PocketBase 标准文件路径自行拼接:`/pb/api/files/{collectionId}/{recordId}/{attachments_link}`
|
||||
parameters:
|
||||
@@ -660,7 +660,7 @@ paths:
|
||||
- 若要按最新上传倒序,传 `sort=-document_create`
|
||||
|
||||
注意:
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ code, msg, data }` 包装
|
||||
- 这是 PocketBase 原生返回结构,不是 hooks 统一 `{ statusCode, errMsg, data }` 包装
|
||||
- 如果需要更复杂的条件组合,可继续使用 PocketBase 原生 `filter` 语法自行扩展
|
||||
parameters:
|
||||
- name: filter
|
||||
@@ -786,17 +786,17 @@ components:
|
||||
ApiResponseBase:
|
||||
type: object
|
||||
required:
|
||||
- code
|
||||
- msg
|
||||
- statusCode
|
||||
- errMsg
|
||||
- data
|
||||
properties:
|
||||
code:
|
||||
statusCode:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
description: "业务状态码"
|
||||
example: 业务状态码 | integer
|
||||
msg:
|
||||
errMsg:
|
||||
type: string
|
||||
description: "业务提示信息"
|
||||
example: 业务提示信息 | string
|
||||
@@ -805,24 +805,24 @@ components:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
example:
|
||||
code: 业务状态码 | integer
|
||||
msg: 业务提示信息 | string
|
||||
statusCode: 业务状态码 | integer
|
||||
errMsg: 业务提示信息 | string
|
||||
data:
|
||||
任意业务字段: 业务响应数据 | object
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- code
|
||||
- msg
|
||||
- statusCode
|
||||
- errMsg
|
||||
- data
|
||||
properties:
|
||||
code:
|
||||
statusCode:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
description: "业务状态码"
|
||||
example: 业务状态码 | integer
|
||||
msg:
|
||||
errMsg:
|
||||
type: string
|
||||
description: "业务提示信息"
|
||||
example: 失败原因提示 | string
|
||||
@@ -831,8 +831,8 @@ components:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
example:
|
||||
code: 业务状态码 | integer
|
||||
msg: 失败原因提示 | string
|
||||
statusCode: 业务状态码 | integer
|
||||
errMsg: 失败原因提示 | string
|
||||
data:
|
||||
任意错误字段: 错误附加信息 | object
|
||||
CompanyInfo:
|
||||
@@ -1698,6 +1698,14 @@ components:
|
||||
type: string
|
||||
description: 可选。未传 `users_phone_code` 时,可直接写入手机号
|
||||
example: '13800138000'
|
||||
users_type:
|
||||
type: string
|
||||
description: 可选。用户类型;仅在传入非空值时更新
|
||||
example: 服务商
|
||||
company_id:
|
||||
type: string
|
||||
description: 可选。公司业务 id;仅在传入非空值时更新
|
||||
example: WX-COMPANY-10001
|
||||
users_tag:
|
||||
type: string
|
||||
description: 可选。用户标签;非空时才更新
|
||||
@@ -1756,8 +1764,8 @@ components:
|
||||
type: string
|
||||
description: PocketBase 原生 auth token
|
||||
example:
|
||||
code: 业务状态码 | integer
|
||||
msg: 业务提示信息 | string
|
||||
statusCode: 业务状态码 | integer
|
||||
errMsg: 业务提示信息 | string
|
||||
data:
|
||||
status: 登录或注册状态 | string
|
||||
is_info_complete: 资料是否完整 | boolean
|
||||
@@ -1835,8 +1843,8 @@ components:
|
||||
description: "业务响应数据"
|
||||
$ref: '#/components/schemas/WechatProfileResponseData'
|
||||
example:
|
||||
code: 业务状态码 | integer
|
||||
msg: 业务提示信息 | string
|
||||
statusCode: 业务状态码 | integer
|
||||
errMsg: 业务提示信息 | string
|
||||
data:
|
||||
status: 资料更新状态 | string
|
||||
user:
|
||||
@@ -1908,8 +1916,8 @@ components:
|
||||
type: string
|
||||
description: 新签发的 PocketBase 原生 auth token
|
||||
example:
|
||||
code: 业务状态码 | integer
|
||||
msg: 刷新成功 | string
|
||||
statusCode: 业务状态码 | integer
|
||||
errMsg: 刷新成功 | string
|
||||
data: {}
|
||||
token: 新签发的PocketBase原生auth token | string
|
||||
UsersCountData:
|
||||
@@ -1929,7 +1937,8 @@ components:
|
||||
description: "业务响应数据"
|
||||
$ref: '#/components/schemas/UsersCountData'
|
||||
example:
|
||||
code: 业务状态码 | integer
|
||||
msg: 业务提示信息 | string
|
||||
statusCode: 业务状态码 | integer
|
||||
errMsg: 业务提示信息 | string
|
||||
data:
|
||||
total_users: 用户总数 | integer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user