docs: 重新生成 swagger 接口文档
This commit is contained in:
@@ -1,95 +1,132 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "文件服务",
|
||||
"description": "处理文件上传与获取",
|
||||
"version": "v1"
|
||||
},
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "文件服务",
|
||||
"version": "v1"
|
||||
},
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/api/v1/files": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "文件获取接口 (如果是私有文件,通过此接口获取或重定向)",
|
||||
"operationId": "fileGetFile",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "key",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"operationId": "GetFile",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"description": "A successful response.",
|
||||
"schema": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "key",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"file"
|
||||
],
|
||||
"consumes": [
|
||||
"multipart/form-data"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/upload": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/x-www-form-urlencoded"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "文件上传接口",
|
||||
"operationId": "fileUpload",
|
||||
"parameters": [
|
||||
{
|
||||
"enum": [
|
||||
"avatar",
|
||||
"chat",
|
||||
"post",
|
||||
"verification",
|
||||
"dispute"
|
||||
],
|
||||
"type": "string",
|
||||
"description": "文件类型限制",
|
||||
"name": "type",
|
||||
"in": "formData",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"operationId": "Upload",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"description": "返回 CDN 地址或访问地址",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
"$ref": "#/definitions/UploadResp"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"description": " 上传请求参数(File文件流在Handler中通过 r.FormFile 获取)",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/UploadReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"file"
|
||||
],
|
||||
"consumes": [
|
||||
"multipart/form-data"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-date": "2026-04-22 22:30:27",
|
||||
"x-description": "This is a goctl generated swagger file.",
|
||||
"x-github": "https://github.com/zeromicro/go-zero",
|
||||
"x-go-zero-doc": "https://go-zero.dev/",
|
||||
"x-goctl-version": "1.10.1"
|
||||
}
|
||||
"definitions": {
|
||||
"GetFileReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "GetFileReq",
|
||||
"required": [
|
||||
"key"
|
||||
]
|
||||
},
|
||||
"UploadReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"avatar",
|
||||
"chat",
|
||||
"post",
|
||||
"verification",
|
||||
"dispute"
|
||||
],
|
||||
"description": " 文件类型限制"
|
||||
}
|
||||
},
|
||||
"title": "UploadReq",
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
},
|
||||
"UploadResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": " 返回 CDN 地址或访问地址"
|
||||
}
|
||||
},
|
||||
"title": "UploadResp",
|
||||
"required": [
|
||||
"url"
|
||||
]
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"apiKey": {
|
||||
"type": "apiKey",
|
||||
"description": "Enter JWT Bearer token **_only_**",
|
||||
"name": "Authorization",
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user