图片功能url实现
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user