feat: 添加 PocketBase 管理端与自定义 hooks 的 API 文档
- 新增 openapi.yaml 文件,定义管理端与自定义 hooks 的接口文档,包括系统、微信认证、平台认证、字典管理、附件管理、文档管理、购物车和订单等接口。 - 新增 order.yaml 文件,定义订单相关的接口,包括查询订单列表、查询订单详情、新增订单记录、修改订单记录和删除订单记录的请求和响应结构。 - 新增 openapi-wx/openapi.yaml 文件,定义 PocketBase 原生 API 文档,包含企业信息、附件信息、产品信息、文档信息、购物车和订单的接口。 - 新增 pocketbase.scheme.js 文件,包含 PocketBase 集合的创建和更新逻辑,定义了多个集合的字段、索引和权限规则。
This commit is contained in:
@@ -1,157 +1,155 @@
|
||||
paths:
|
||||
cartList:
|
||||
post:
|
||||
operationId: postCartList
|
||||
tags:
|
||||
- 购物车
|
||||
summary: 按索引字段模糊查询购物车列表
|
||||
cartRecords:
|
||||
get:
|
||||
tags: [购物车]
|
||||
summary: 查询购物车记录列表
|
||||
description: |
|
||||
调用自定义 hooks API 查询当前登录用户的购物车列表。
|
||||
|
||||
查询规则:
|
||||
- 仅允许查询当前 `Authorization` 对应用户自己的购物车记录
|
||||
- 支持通过 `keyword` 对多个索引相关字段做统一模糊搜索,当前实现覆盖:
|
||||
- `cart_id`
|
||||
- `cart_number`
|
||||
- `cart_product_id`
|
||||
- `product_name`
|
||||
- 支持按 `cart_status` 精确过滤
|
||||
- 支持按 `cart_number` 精确过滤
|
||||
|
||||
目标软删除契约:
|
||||
- 目标行为应仅返回 `is_delete = 0` 的记录
|
||||
- 当前仓库实现尚未显式追加 `is_delete = 0` 过滤,请以实际后端代码为准
|
||||
security:
|
||||
- BearerAuth: []
|
||||
requestBody:
|
||||
required: false
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/CartListRequest
|
||||
example:
|
||||
keyword: 对 cart_id、cart_number、cart_product_id 等索引相关字段的统一模糊搜索关键字|string
|
||||
cart_status: 购物车状态精确过滤|string
|
||||
cart_number: 购物车名称或分组号精确过滤|string
|
||||
使用 PocketBase 原生 records list 接口查询 `tbl_cart`。
|
||||
如需鉴权,请自行在请求头中携带 `Authorization: Bearer <token>`。
|
||||
parameters:
|
||||
- name: filter
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
description: PocketBase 原生过滤表达式
|
||||
example: cart_id="购物车业务ID|string"
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: 1
|
||||
- name: perPage
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: 20
|
||||
- name: sort
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: -cart_create
|
||||
responses:
|
||||
"200":
|
||||
'200':
|
||||
description: 查询成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/CartListResponse
|
||||
example:
|
||||
items:
|
||||
- pb_id: PocketBase 记录主键 id|string
|
||||
created: PocketBase 系统创建时间|string
|
||||
updated: PocketBase 系统更新时间|string
|
||||
cart_id: 购物车业务 ID|string
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
cart_remark: 备注|string
|
||||
is_delete: 软删除标记;目标契约字段,当前 hooks 响应可能尚未显式透出|integer
|
||||
product_name: 产品名称(服务端联动补充)|string
|
||||
product_modelnumber: 产品型号(服务端联动补充)|string
|
||||
product_basic_price: 产品基础价格(服务端联动补充)|integer
|
||||
"400":
|
||||
description: 参数错误
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
|
||||
example:
|
||||
statusCode: 业务状态码|integer
|
||||
errMsg: 业务提示信息|string
|
||||
data:
|
||||
业务响应数据字段|string: 业务响应数据值|string
|
||||
"401":
|
||||
description: token 缺失、无效或已过期
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
|
||||
example:
|
||||
statusCode: 业务状态码|integer
|
||||
errMsg: 业务提示信息|string
|
||||
data:
|
||||
业务响应数据字段|string: 业务响应数据值|string
|
||||
"415":
|
||||
description: 请求体必须为 application/json
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
|
||||
example:
|
||||
statusCode: 业务状态码|integer
|
||||
errMsg: 业务提示信息|string
|
||||
data:
|
||||
业务响应数据字段|string: 业务响应数据值|string
|
||||
"500":
|
||||
$ref: '#/components/schemas/PocketBaseCartListResponse'
|
||||
'400':
|
||||
description: 查询参数错误
|
||||
'401':
|
||||
description: token 无效或已过期
|
||||
'403':
|
||||
description: 无权访问
|
||||
'500':
|
||||
description: 服务端错误
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/ErrorResponse
|
||||
example:
|
||||
statusCode: 业务状态码|integer
|
||||
errMsg: 业务提示信息|string
|
||||
data:
|
||||
业务响应数据字段|string: 业务响应数据值|string
|
||||
cartDetail:
|
||||
post:
|
||||
operationId: postCartDetail
|
||||
tags:
|
||||
- 购物车
|
||||
summary: 按 cart_id 精确查询购物车详情
|
||||
tags: [购物车]
|
||||
summary: 创建购物车记录
|
||||
description: |
|
||||
调用自定义 hooks API 按 `cart_id` 查询单条购物车记录。
|
||||
|
||||
查询规则:
|
||||
- 仅允许访问当前 `Authorization` 对应用户自己的购物车记录
|
||||
- 查询键为业务 ID `cart_id`,不是 PocketBase 原生 `recordId`
|
||||
|
||||
目标软删除契约:
|
||||
- 目标行为应仅允许查询 `is_delete = 0` 的记录
|
||||
- 当前仓库实现尚未显式追加 `is_delete = 0` 过滤,请以实际后端代码为准
|
||||
security:
|
||||
- BearerAuth: []
|
||||
使用 PocketBase 原生 records create 接口向 `tbl_cart` 新增记录。
|
||||
如集合规则要求 `cart_owner` 与当前用户一致,请客户端显式提交。
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/CartDetailRequest
|
||||
$ref: '#/components/schemas/PocketBaseCartCreateRequest'
|
||||
example:
|
||||
cart_id: 购物车业务 ID|string
|
||||
cart_id: 购物车业务ID|string
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_owner: 购物车所有者openid|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|number
|
||||
cart_remark: 备注|string
|
||||
responses:
|
||||
"200":
|
||||
description: 查询成功
|
||||
'200':
|
||||
description: 创建成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/CartRecord
|
||||
example:
|
||||
pb_id: PocketBase 记录主键 id|string
|
||||
created: PocketBase 系统创建时间|string
|
||||
updated: PocketBase 系统更新时间|string
|
||||
cart_id: 购物车业务 ID|string
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
cart_remark: 备注|string
|
||||
is_delete: 软删除标记;目标契约字段,当前 hooks 响应可能尚未显式透出|integer
|
||||
product_name: 产品名称(服务端联动补充)|string
|
||||
product_modelnumber: 产品型号(服务端联动补充)|string
|
||||
product_basic_price: 产品基础价格(服务端联动补充)|integer
|
||||
$ref: '#/components/schemas/PocketBaseCartRecord'
|
||||
'400':
|
||||
description: 参数错误或违反集合规则
|
||||
'401':
|
||||
description: token 无效或已过期
|
||||
'403':
|
||||
description: 无权访问
|
||||
'500':
|
||||
description: 服务端错误
|
||||
cartRecordById:
|
||||
patch:
|
||||
tags: [购物车]
|
||||
summary: 更新购物车记录
|
||||
description: |
|
||||
使用 PocketBase 原生 records update 接口更新 `tbl_cart`。
|
||||
路径参数使用 PocketBase 原生 `recordId`。
|
||||
parameters:
|
||||
- name: recordId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: PocketBase记录主键|string
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PocketBaseCartUpdateRequest'
|
||||
example:
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_owner: 购物车所有者openid|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|number
|
||||
cart_remark: 备注|string
|
||||
responses:
|
||||
'200':
|
||||
description: 更新成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PocketBaseCartRecord'
|
||||
'400':
|
||||
description: 参数错误
|
||||
'401':
|
||||
description: token 无效或已过期
|
||||
'404':
|
||||
description: 记录不存在
|
||||
'500':
|
||||
description: 服务端错误
|
||||
delete:
|
||||
tags: [购物车]
|
||||
summary: 删除购物车记录
|
||||
description: |
|
||||
使用 PocketBase 原生 records delete 接口删除 `tbl_cart`。
|
||||
路径参数使用 PocketBase 原生 `recordId`。
|
||||
parameters:
|
||||
- name: recordId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: PocketBase记录主键|string
|
||||
responses:
|
||||
'204':
|
||||
description: 删除成功
|
||||
'401':
|
||||
description: token 无效或已过期
|
||||
'404':
|
||||
description: 记录不存在
|
||||
'500':
|
||||
description: 服务端错误
|
||||
"400":
|
||||
description: 参数错误
|
||||
content:
|
||||
@@ -231,7 +229,8 @@ paths:
|
||||
- 服务端自动根据当前 token 写入 `cart_owner`
|
||||
- 服务端自动生成 `cart_id`
|
||||
- 若未传 `cart_number`,服务端会自动生成展示编号
|
||||
- `cart_product_id`、`cart_product_quantity`、`cart_at_price` 为必填
|
||||
- `cart_product_id` 为必填;当前 hooks 与库结构保持一致,必须传 `tbl_product_list` 的 `recordId`
|
||||
- `cart_product_quantity`、`cart_at_price` 为必填
|
||||
|
||||
目标软删除契约:
|
||||
- 新建记录应默认为 `is_delete = 0`
|
||||
@@ -246,7 +245,7 @@ paths:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/CartCreateRequest
|
||||
example:
|
||||
cart_number: 可选;未传时服务端自动生成|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_quantity: 产品数量,需为正整数|integer
|
||||
cart_status: 可选;未传时默认 有效|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
@@ -266,7 +265,8 @@ paths:
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_id: 关联产品的 PocketBase recordId|string
|
||||
cart_product_business_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
@@ -354,7 +354,7 @@ paths:
|
||||
example:
|
||||
cart_id: 购物车业务 ID|string
|
||||
cart_number: cart_number|string
|
||||
cart_product_id: cart_product_id|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_quantity: cart_product_quantity|integer
|
||||
cart_status: cart_status|string
|
||||
cart_at_price: cart_at_price|integer
|
||||
@@ -374,7 +374,8 @@ paths:
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_id: 关联产品的 PocketBase recordId|string
|
||||
cart_product_business_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
@@ -710,8 +711,9 @@ paths:
|
||||
使用 PocketBase 原生 records create 接口向 `tbl_cart` 新增记录。
|
||||
|
||||
当前线上权限规则:
|
||||
- `createRule = @request.auth.id != "" && @request.body.cart_owner = @request.auth.openid`
|
||||
- 因此客户端创建时必须显式提交 `cart_owner`,并且值必须等于当前 token 对应的 `openid`
|
||||
- `createRule = @request.body.cart_owner != ""`
|
||||
- 因此客户端创建时必须显式提交非空 `cart_owner`
|
||||
- `cart_product_id` 当前为 relation 字段,必须传 `tbl_product_list` 的 PocketBase `recordId`
|
||||
|
||||
这意味着:
|
||||
- 不能依赖服务端自动补 owner
|
||||
@@ -728,11 +730,11 @@ paths:
|
||||
example:
|
||||
cart_id: cart_id|string
|
||||
cart_number: cart_number|string
|
||||
cart_owner: 必须显式提交,且值必须等于当前 token 对应 openid|string
|
||||
cart_product_id: cart_product_id|string
|
||||
cart_product_quantity: cart_product_quantity|integer
|
||||
cart_status: cart_status|string
|
||||
cart_at_price: cart_at_price|number
|
||||
cart_owner: 必须显式提交非空 owner|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_quantity: cart_product_quantity|integer,可为空
|
||||
cart_status: cart_status|string,可为空
|
||||
cart_at_price: cart_at_price|number,可为空
|
||||
cart_remark: cart_remark|string
|
||||
responses:
|
||||
"200":
|
||||
@@ -751,7 +753,7 @@ paths:
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_id: 关联产品的 PocketBase recordId|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|number
|
||||
@@ -963,77 +965,6 @@ paths:
|
||||
业务响应数据字段|string: 业务响应数据值|string
|
||||
components:
|
||||
schemas:
|
||||
ApiResponseBase:
|
||||
type: object
|
||||
required:
|
||||
- statusCode
|
||||
- errMsg
|
||||
- data
|
||||
properties:
|
||||
statusCode:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
description: 业务状态码
|
||||
example: 业务状态码 | integer
|
||||
errMsg:
|
||||
type: string
|
||||
description: 业务提示信息
|
||||
example: 业务提示信息 | string
|
||||
data:
|
||||
description: 业务响应数据
|
||||
type: object
|
||||
additionalProperties: true
|
||||
example:
|
||||
statusCode: 业务状态码|integer
|
||||
errMsg: 业务提示信息|string
|
||||
data:
|
||||
业务响应数据字段|string: 业务响应数据值|string
|
||||
ErrorResponse:
|
||||
type: object
|
||||
required:
|
||||
- statusCode
|
||||
- errMsg
|
||||
- data
|
||||
properties:
|
||||
statusCode:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
description: 业务状态码
|
||||
example: 业务状态码 | integer
|
||||
errMsg:
|
||||
type: string
|
||||
description: 业务提示信息
|
||||
example: 失败原因提示 | string
|
||||
data:
|
||||
description: 业务响应数据
|
||||
type: object
|
||||
additionalProperties: true
|
||||
example:
|
||||
statusCode: 业务状态码|integer
|
||||
errMsg: 业务提示信息|string
|
||||
data:
|
||||
业务响应数据字段|string: 业务响应数据值|string
|
||||
HookRecordBase:
|
||||
type: object
|
||||
properties:
|
||||
pb_id:
|
||||
type: string
|
||||
description: PocketBase 记录主键 id
|
||||
example: l2r3nq7rqhuob0h
|
||||
created:
|
||||
type: string
|
||||
description: PocketBase 系统创建时间
|
||||
example: 2026-04-03 15:30:00.000Z
|
||||
updated:
|
||||
type: string
|
||||
description: PocketBase 系统更新时间
|
||||
example: 2026-04-03 15:35:00.000Z
|
||||
example:
|
||||
pb_id: PocketBase 记录主键 id|string
|
||||
created: PocketBase 系统创建时间|string
|
||||
updated: PocketBase 系统更新时间|string
|
||||
PocketBaseNativeError:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1041,13 +972,14 @@ components:
|
||||
type:
|
||||
- integer
|
||||
- string
|
||||
description: 业务状态码
|
||||
description: PocketBase错误码
|
||||
example: 错误状态码 | integer
|
||||
message:
|
||||
type: string
|
||||
description: PocketBase错误信息
|
||||
example: PocketBase原生错误信息 | string
|
||||
data:
|
||||
description: 业务响应数据
|
||||
description: PocketBase错误数据
|
||||
type: object
|
||||
additionalProperties: true
|
||||
example:
|
||||
@@ -1088,245 +1020,6 @@ components:
|
||||
collectionName: collectionName|string
|
||||
created: 记录创建时间|string
|
||||
updated: 记录更新时间|string
|
||||
CartRecord:
|
||||
allOf:
|
||||
- $ref: ../openapi-wx.yaml#/components/schemas/HookRecordBase
|
||||
- type: object
|
||||
properties:
|
||||
cart_id:
|
||||
type: string
|
||||
description: 购物车业务 ID
|
||||
example: CART-1770000000000-abc123
|
||||
cart_number:
|
||||
type: string
|
||||
description: 购物车名称或分组号
|
||||
example: wx-user-20260403153000
|
||||
cart_create:
|
||||
type: string
|
||||
description: 购物车项创建时间,由数据库自动生成
|
||||
example: 2026-04-03 15:30:00.000Z
|
||||
cart_owner:
|
||||
type: string
|
||||
description: 购物车所有者 openid
|
||||
example: wx-openid-user-001
|
||||
cart_product_id:
|
||||
type: string
|
||||
description: 产品业务 ID
|
||||
example: PROD-1770000000000-abcd12
|
||||
cart_product_quantity:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
description: 产品数量
|
||||
example: 2
|
||||
cart_status:
|
||||
type: string
|
||||
description: 购物车状态
|
||||
example: 有效
|
||||
cart_at_price:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
description: 加入购物车时价格
|
||||
example: 1999
|
||||
cart_remark:
|
||||
type: string
|
||||
description: 备注
|
||||
example: 小程序加入购物车示例
|
||||
is_delete:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
description: 软删除标记;目标契约字段,当前 hooks 响应可能尚未显式透出
|
||||
example: 0
|
||||
product_name:
|
||||
type: string
|
||||
description: 产品名称(服务端联动补充)
|
||||
example: BAI 智能主机
|
||||
product_modelnumber:
|
||||
type: string
|
||||
description: 产品型号(服务端联动补充)
|
||||
example: BAI-HOST-01
|
||||
product_basic_price:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
- "null"
|
||||
description: 产品基础价格(服务端联动补充)
|
||||
example: 1999
|
||||
example:
|
||||
pb_id: PocketBase 记录主键 id|string
|
||||
created: PocketBase 系统创建时间|string
|
||||
updated: PocketBase 系统更新时间|string
|
||||
cart_id: 购物车业务 ID|string
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
cart_remark: 备注|string
|
||||
is_delete: 软删除标记;目标契约字段,当前 hooks 响应可能尚未显式透出|integer
|
||||
product_name: 产品名称(服务端联动补充)|string
|
||||
product_modelnumber: 产品型号(服务端联动补充)|string
|
||||
product_basic_price: 产品基础价格(服务端联动补充)|integer
|
||||
CartListRequest:
|
||||
type: object
|
||||
properties:
|
||||
keyword:
|
||||
type: string
|
||||
description: 对 `cart_id`、`cart_number`、`cart_product_id` 等索引相关字段的统一模糊搜索关键字
|
||||
example: CART-1770
|
||||
cart_status:
|
||||
type: string
|
||||
description: 购物车状态精确过滤
|
||||
example: 有效
|
||||
cart_number:
|
||||
type: string
|
||||
description: 购物车名称或分组号精确过滤
|
||||
example: wx-user-20260403153000
|
||||
example:
|
||||
keyword: 对 cart_id、cart_number、cart_product_id 等索引相关字段的统一模糊搜索关键字|string
|
||||
cart_status: 购物车状态精确过滤|string
|
||||
cart_number: 购物车名称或分组号精确过滤|string
|
||||
CartDetailRequest:
|
||||
type: object
|
||||
required:
|
||||
- cart_id
|
||||
properties:
|
||||
cart_id:
|
||||
type: string
|
||||
description: 购物车业务 ID
|
||||
example: CART-1770000000000-abc123
|
||||
example:
|
||||
cart_id: 购物车业务 ID|string
|
||||
CartCreateRequest:
|
||||
type: object
|
||||
required:
|
||||
- cart_product_id
|
||||
- cart_product_quantity
|
||||
- cart_at_price
|
||||
properties:
|
||||
cart_number:
|
||||
type: string
|
||||
description: 可选;未传时服务端自动生成
|
||||
cart_product_id:
|
||||
type: string
|
||||
description: 产品业务 ID
|
||||
example: PROD-1770000000000-abcd12
|
||||
cart_product_quantity:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
description: 产品数量,需为正整数
|
||||
example: 2
|
||||
cart_status:
|
||||
type: string
|
||||
description: 可选;未传时默认 `有效`
|
||||
example: 有效
|
||||
cart_at_price:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
description: 加入购物车时价格
|
||||
example: 1999
|
||||
cart_remark:
|
||||
type: string
|
||||
description: 备注
|
||||
example: 小程序加入购物车示例
|
||||
example:
|
||||
cart_number: 可选;未传时服务端自动生成|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量,需为正整数|integer
|
||||
cart_status: 可选;未传时默认 有效|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
cart_remark: 备注|string
|
||||
CartUpdateRequest:
|
||||
type: object
|
||||
required:
|
||||
- cart_id
|
||||
properties:
|
||||
cart_id:
|
||||
type: string
|
||||
description: 购物车业务 ID
|
||||
example: CART-1770000000000-abc123
|
||||
cart_number:
|
||||
type: string
|
||||
cart_product_id:
|
||||
type: string
|
||||
cart_product_quantity:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
cart_status:
|
||||
type: string
|
||||
cart_at_price:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
cart_remark:
|
||||
type: string
|
||||
example:
|
||||
cart_id: 购物车业务 ID|string
|
||||
cart_number: cart_number|string
|
||||
cart_product_id: cart_product_id|string
|
||||
cart_product_quantity: cart_product_quantity|integer
|
||||
cart_status: cart_status|string
|
||||
cart_at_price: cart_at_price|integer
|
||||
cart_remark: cart_remark|string
|
||||
CartDeleteRequest:
|
||||
type: object
|
||||
required:
|
||||
- cart_id
|
||||
properties:
|
||||
cart_id:
|
||||
type: string
|
||||
description: 购物车业务 ID
|
||||
example: CART-1770000000000-abc123
|
||||
example:
|
||||
cart_id: 购物车业务 ID|string
|
||||
CartListResponse:
|
||||
type: object
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/CartRecord
|
||||
example:
|
||||
items:
|
||||
- pb_id: PocketBase 记录主键 id|string
|
||||
created: PocketBase 系统创建时间|string
|
||||
updated: PocketBase 系统更新时间|string
|
||||
cart_id: 购物车业务 ID|string
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|integer
|
||||
cart_remark: 备注|string
|
||||
is_delete: 软删除标记;目标契约字段,当前 hooks 响应可能尚未显式透出|integer
|
||||
product_name: 产品名称(服务端联动补充)|string
|
||||
product_modelnumber: 产品型号(服务端联动补充)|string
|
||||
product_basic_price: 产品基础价格(服务端联动补充)|integer
|
||||
CartDeleteResponse:
|
||||
type: object
|
||||
properties:
|
||||
cart_id:
|
||||
type: string
|
||||
description: 购物车业务 ID
|
||||
example: CART-1770000000000-abc123
|
||||
is_delete:
|
||||
type:
|
||||
- integer
|
||||
- number
|
||||
description: 目标软删除标记值;当前实现可能仍返回物理删除结果
|
||||
example: 1
|
||||
example:
|
||||
cart_id: 购物车业务 ID|string
|
||||
is_delete: 目标软删除标记值;当前实现可能仍返回物理删除结果|integer
|
||||
PocketBaseCartFields:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1348,7 +1041,11 @@ components:
|
||||
example: wx-openid-user-001
|
||||
cart_product_id:
|
||||
type: string
|
||||
description: 产品业务 ID
|
||||
description: 关联产品的 PocketBase recordId
|
||||
example: pbc_product_record_id|string
|
||||
cart_product_business_id:
|
||||
type: string
|
||||
description: 关联产品的业务 ID(prod_list_id),用于展示
|
||||
example: PROD-1770000000000-abcd12
|
||||
cart_product_quantity:
|
||||
type:
|
||||
@@ -1375,7 +1072,8 @@ components:
|
||||
cart_number: 购物车名称或分组号|string
|
||||
cart_create: 购物车项创建时间,由数据库自动生成|string
|
||||
cart_owner: 购物车所有者 openid|string
|
||||
cart_product_id: 产品业务 ID|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_business_id: 产品业务 ID|string
|
||||
cart_product_quantity: 产品数量|integer
|
||||
cart_status: 购物车状态|string
|
||||
cart_at_price: 加入购物车时价格|number
|
||||
@@ -1402,13 +1100,8 @@ components:
|
||||
PocketBaseCartCreateRequest:
|
||||
type: object
|
||||
required:
|
||||
- cart_id
|
||||
- cart_number
|
||||
- cart_owner
|
||||
- cart_product_id
|
||||
- cart_product_quantity
|
||||
- cart_status
|
||||
- cart_at_price
|
||||
properties:
|
||||
cart_id:
|
||||
type: string
|
||||
@@ -1416,9 +1109,10 @@ components:
|
||||
type: string
|
||||
cart_owner:
|
||||
type: string
|
||||
description: 必须显式提交,且值必须等于当前 token 对应 openid
|
||||
description: 必须显式提交非空 owner
|
||||
cart_product_id:
|
||||
type: string
|
||||
description: tbl_product_list 的 PocketBase recordId
|
||||
cart_product_quantity:
|
||||
type:
|
||||
- integer
|
||||
@@ -1432,13 +1126,11 @@ components:
|
||||
cart_remark:
|
||||
type: string
|
||||
example:
|
||||
cart_id: cart_id|string
|
||||
cart_number: cart_number|string
|
||||
cart_owner: 必须显式提交,且值必须等于当前 token 对应 openid|string
|
||||
cart_product_id: cart_product_id|string
|
||||
cart_product_quantity: cart_product_quantity|integer
|
||||
cart_status: cart_status|string
|
||||
cart_at_price: cart_at_price|number
|
||||
cart_owner: 必须显式提交非空 owner|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_quantity: cart_product_quantity|integer,可为空
|
||||
cart_status: cart_status|string,可为空
|
||||
cart_at_price: cart_at_price|number,可为空
|
||||
cart_remark: cart_remark|string
|
||||
PocketBaseCartUpdateRequest:
|
||||
type: object
|
||||
@@ -1447,9 +1139,10 @@ components:
|
||||
type: string
|
||||
cart_owner:
|
||||
type: string
|
||||
description: 若提交,必须仍等于当前 token 对应 openid
|
||||
description: 若提交,必须仍为非空 owner
|
||||
cart_product_id:
|
||||
type: string
|
||||
description: tbl_product_list 的 PocketBase recordId
|
||||
cart_product_quantity:
|
||||
type:
|
||||
- integer
|
||||
@@ -1464,8 +1157,8 @@ components:
|
||||
type: string
|
||||
example:
|
||||
cart_number: cart_number|string
|
||||
cart_owner: 若提交,必须仍等于当前 token 对应 openid|string
|
||||
cart_product_id: cart_product_id|string
|
||||
cart_owner: 若提交,必须仍为非空 owner|string
|
||||
cart_product_id: tbl_product_list 的 PocketBase recordId|string
|
||||
cart_product_quantity: cart_product_quantity|integer
|
||||
cart_status: cart_status|string
|
||||
cart_at_price: cart_at_price|number
|
||||
|
||||
Reference in New Issue
Block a user