feat: 更新 PocketBase API 路由,增强认证安全性
- 修改登录路由为 `/pb/api/wechat/login`,新增局部 try/catch 以保留业务状态码并返回统一结构 `{ code, msg, data }`。
- 更新所有相关 API 路由前缀为 `/pb`,包括系统、平台、字典、附件和文档接口。
- 新增文档接口支持多个附件 ID,更新 OpenAPI 文档以反映这些变化。
- 在数据库模式中添加对字典名称的唯一索引,确保全局唯一性。
- 更新文档字段,设置 `document_title` 和 `document_type` 为必填项,并在验证过程中检查字段的必填属性。
This commit is contained in:
@@ -4,10 +4,11 @@
|
||||
|
||||
补充约定:
|
||||
|
||||
- `document_image`、`document_video` 只保存关联的 `attachments_id`,不直接存文件。
|
||||
- `document_image`、`document_video` 只保存关联的 `attachments_id`,不直接存文件;当存在多个附件时,统一使用 `|` 分隔,例如:`ATT-001|ATT-002|ATT-003`。
|
||||
- `document_keywords`、`document_product_categories`、`document_application_scenarios`、`document_hotel_type` 统一使用竖线分隔字符串,例如:`分类A|分类B|分类C`。
|
||||
- `document_owner` 的业务含义为“上传者openid”。
|
||||
- `attachments_link` 是 PocketBase `file` 字段,保存附件本体;访问链接由 PocketBase 根据记录和文件名生成。
|
||||
- 文档字段中,面向用户填写的字段里只有 `document_title`、`document_type` 设为必填,其余字段均允许为空。
|
||||
|
||||
---
|
||||
|
||||
@@ -45,13 +46,13 @@
|
||||
| document_id | text | 文档业务 id,唯一标识符 |
|
||||
| document_effect_date | date | 文档生效日期 |
|
||||
| document_expiry_date | date | 文档到期日期 |
|
||||
| document_type | text | 文档类型 |
|
||||
| document_title | text | 文档标题 |
|
||||
| document_type | text | 文档类型,必填 |
|
||||
| document_title | text | 文档标题,必填 |
|
||||
| document_subtitle | text | 文档副标题 |
|
||||
| document_summary | text | 文档摘要 |
|
||||
| document_content | text | 正文内容,保存 Markdown 原文 |
|
||||
| document_image | text | 关联 `attachments_id` |
|
||||
| document_video | text | 关联 `attachments_id` |
|
||||
| document_image | text | 关联多个 `attachments_id`,使用 `|` 分隔 |
|
||||
| document_video | text | 关联多个 `attachments_id`,使用 `|` 分隔 |
|
||||
| document_owner | text | 上传者openid |
|
||||
| document_relation_model | text | 关联机型/模型标识 |
|
||||
| document_keywords | text | 关键词,竖线分隔 |
|
||||
|
||||
Reference in New Issue
Block a user