feat: 添加购物车相关迁移和索引功能
- 在 package.json 中添加迁移脚本 `migrate:cart-active-unique-index`。 - 修改 `pocketbase.cart-order.js` 文件,更新 `cart_id` 和 `cart_product_id` 字段的必填属性,并添加唯一索引 `idx_tbl_cart_owner_product_active_unique`。 - 在 `pocketbase.ensure-cart-order-autogen-id.js` 中,调整 `cart_id` 字段的必填属性为可选,并确保 `order_id` 字段为必填。 - 在 `pocketbase.product-list.js` 中,新增 `prod_list_barcode` 字段。 - 新增 `make-openapi-standalone.cjs` 脚本,用于处理 OpenAPI 文档。 - 新增 `pocketbase.cart-active-unique-index.js` 脚本,处理购物车的唯一索引和去重逻辑。
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: BAI PocketBase Native API - Attachments
|
||||
version: 1.0.0
|
||||
description: |
|
||||
PocketBase 原生 `tbl_attachments` records API 文档。
|
||||
本文件可单独导入使用,不依赖其他 YAML。
|
||||
servers:
|
||||
- url: https://bai-api.blv-oa.com
|
||||
description: 生产环境
|
||||
- url: http://localhost:8090
|
||||
description: PocketBase 本地环境
|
||||
paths:
|
||||
attachmentRecords:
|
||||
/pb/api/collections/tbl_attachments/records:
|
||||
get:
|
||||
operationId: getPocketBaseAttachmentRecords
|
||||
tags:
|
||||
@@ -38,7 +50,7 @@ paths:
|
||||
- 不传该参数时,返回分页列表
|
||||
schema:
|
||||
type: string
|
||||
example: attachments_id="ATT-1774599142438-8n1UcU"
|
||||
example: 过滤表达式|string
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
@@ -60,8 +72,6 @@ paths:
|
||||
description: 查询成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/PocketBaseAttachmentListResponse
|
||||
example:
|
||||
page: page|integer
|
||||
perPage: perPage|integer
|
||||
@@ -85,8 +95,6 @@ paths:
|
||||
description: 查询参数错误
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/PocketBaseNativeError
|
||||
example:
|
||||
code: 业务状态码|integer
|
||||
message: message|string
|
||||
@@ -97,7 +105,7 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/PocketBaseNativeError
|
||||
$ref: #/components/schemas/PocketBaseNativeError
|
||||
example:
|
||||
code: 业务状态码|integer
|
||||
message: message|string
|
||||
@@ -108,7 +116,7 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/PocketBaseNativeError
|
||||
$ref: #/components/schemas/PocketBaseNativeError
|
||||
example:
|
||||
code: 业务状态码|integer
|
||||
message: message|string
|
||||
@@ -240,8 +248,6 @@ components:
|
||||
example: 总页数 | integer
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: ../openapi-wx.yaml#/components/schemas/PocketBaseAttachmentRecord
|
||||
example:
|
||||
page: page|integer
|
||||
perPage: perPage|integer
|
||||
|
||||
Reference in New Issue
Block a user