feat: 添加 PocketBase MiniApp 公司 API 文档和文件字段迁移脚本
- 新增 openapi-miniapp-company.yaml 文件,定义 tbl_company 的基础 CRUD 接口文档,包括查询、创建、更新和删除公司记录的详细描述和示例。 - 新增 pocketbase.file-fields-to-attachments.js 脚本,用于迁移 PocketBase 中的文件字段到文本字段,并处理 tbl_attachments 集合的公开规则。
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
|
||||
补充约定:
|
||||
|
||||
- `document_image`、`document_video` 只保存关联的 `attachments_id`,不直接存文件;当存在多个附件时,统一使用 `|` 分隔,例如:`ATT-001|ATT-002|ATT-003`。
|
||||
- `document_image`、`document_video`、`document_file` 只保存关联的 `attachments_id`,不直接存文件;当存在多个附件时,统一使用 `|` 分隔,例如:`ATT-001|ATT-002|ATT-003`。
|
||||
- `document_type` 使用多选字符串持久化,但格式特殊:`system_dict_id@dict_word_enum|system_dict_id@dict_word_enum`;前端显示时用枚举值描述,存库时保留该组合值。
|
||||
- `document_keywords`、`document_product_categories`、`document_application_scenarios`、`document_hotel_type` 统一使用竖线分隔字符串,例如:`分类A|分类B|分类C`。
|
||||
- `document_status` 仅允许 `有效`、`过期` 两种值,并由系统根据生效日期与到期日期自动计算;当两者都为空时默认 `有效`。
|
||||
- `document_owner` 的业务含义为“上传者openid”。
|
||||
- `attachments_link` 是 PocketBase `file` 字段,保存附件本体;访问链接由 PocketBase 根据记录和文件名生成。
|
||||
- `tbl_attachments` 的文件查看/下载权限应保持公开;真正的业务访问控制交由引用 `attachments_id` 的业务表和业务接口决定。
|
||||
- 文档字段中,面向用户填写的字段里只有 `document_title`、`document_type` 设为必填,其余字段均允许为空。
|
||||
|
||||
---
|
||||
@@ -55,6 +56,7 @@
|
||||
| document_content | text | 正文内容,保存 Markdown 原文 |
|
||||
| document_image | text | 关联多个 `attachments_id`,使用 `|` 分隔 |
|
||||
| document_video | text | 关联多个 `attachments_id`,使用 `|` 分隔 |
|
||||
| document_file | text | 关联多个 `attachments_id`,使用 `|` 分隔 |
|
||||
| document_owner | text | 上传者openid |
|
||||
| document_relation_model | text | 关联机型/模型标识 |
|
||||
| document_keywords | text | 关键词,多选后用 `|` 分隔保存 |
|
||||
|
||||
Reference in New Issue
Block a user