实现文件上传

This commit is contained in:
2026-06-06 17:22:01 +08:00
parent 1b39b2d411
commit b00782b3f6
10 changed files with 398 additions and 7 deletions

View File

@@ -1902,6 +1902,27 @@ components:
required:
- id
ArticleUploadResponse:
type: object
properties:
url:
type: string
path:
type: string
original_name:
type: string
size:
type: integer
format: int64
mime_type:
type: string
required:
- url
- path
- original_name
- size
- mime_type
PageArticleGroupRequest:
allOf:
- $ref: "#/components/schemas/PageRequest"
@@ -5776,6 +5797,34 @@ paths:
default:
$ref: "#/components/responses/PlainTextError"
/api/admin/article/upload:
post:
tags: [admin/article]
summary: 上传文章图片
security:
- bearerAuth: []
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
required:
- file
responses:
"200":
description: 上传结果
content:
application/json:
schema:
$ref: "#/components/schemas/ArticleUploadResponse"
default:
$ref: "#/components/responses/PlainTextError"
/api/admin/article-group/page:
post:
tags: [admin/article-group]