图片功能url实现

This commit is contained in:
2025-09-21 16:01:59 +08:00
parent e5eb8d6174
commit 39679f7330
15 changed files with 538 additions and 73 deletions

View File

@@ -876,8 +876,8 @@ paths:
direction: { type: string }
/api/attachments:
post:
summary: 上传附件(✅ Fully Implemented占位图方案
description: 接收 multipart 上传但忽略文件内容,始终返回占位图 URL后端配置项 `attachments.placeholder.image-path` 指向本地占位图片URL 固定 `/api/attachments/placeholder` 可通过 `attachments.placeholder.url-path` 覆盖)
summary: 上传附件(❌ Partially Implemented已废弃采用纯URL引用
description: 方案A采用纯URL引用不再支持文件直传。历史兼容此接口仍存在但返回占位图 URL建议前端改用 `/api/attachments/validate-url` 进行URL校验后直接写入业务字段
requestBody:
required: true
content:
@@ -902,6 +902,36 @@ paths:
properties:
url:
type: string
/api/attachments/validate-url:
post:
summary: 校验图片URL✅ Fully Implemented
description: 提交外部图片URL后端进行白名单、SSR防护、类型与大小校验返回标准化后的可用URL和元信息。支持 `application/json` 与 `application/x-www-form-urlencoded`。
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
url: { type: string }
required: [url]
application/x-www-form-urlencoded:
schema:
type: object
properties:
url: { type: string }
required: [url]
responses:
'200':
description: 成功
content:
application/json:
schema:
type: object
properties:
url: { type: string }
contentType: { type: string }
contentLength: { type: integer, format: int64, nullable: true }
/api/attachments/placeholder:
get:
summary: 附件占位图读取(✅ Fully Implemented