basePath: / definitions: biz.articleUploadData: properties: alt: type: string url: type: string type: object biz.articleUploadResponse: properties: data: $ref: '#/definitions/biz.articleUploadData' errno: type: integer msg: type: string type: object biz.attachmentDoc: properties: created_at: type: integer enable: type: boolean ext: type: string hash: type: string height: type: integer id: type: integer ip: type: string name: type: string path: type: string size: type: integer type: type: integer type_id: type: integer type_name: type: string updated_at: type: integer user_id: type: integer username: type: string width: type: integer type: object biz.ginResponse: properties: code: type: integer data: {} error: type: string message: type: string type: object biz.ginResponseAttachment: properties: code: type: integer data: $ref: '#/definitions/biz.attachmentDoc' error: type: string message: type: string type: object biz.ginResponseUploadDocument: properties: code: type: integer data: $ref: '#/definitions/biz.uploadDocumentData' error: type: string message: type: string type: object biz.uploadDocumentData: properties: id: type: integer type: object info: contact: {} description: |- MoreDoc 后端 API 文档,包含 Gin 原生接口的 Swagger 描述。 通过 gRPC Gateway 暴露的接口仍按 proto/openapi 流程维护,Swagger 页面主要覆盖 Gin 侧文件上传与静态资源相关接口。 title: MoreDoc API version: "1.0" paths: /api/v1/upload/article: post: consumes: - multipart/form-data description: 上传文章编辑器使用的图片或视频资源。 parameters: - description: 资源类型(image/video) in: query name: type required: true type: string - description: 文章资源文件 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/biz.articleUploadResponse' security: - BearerAuth: [] summary: 上传文章资源 tags: - attachment /api/v1/upload/avatar: post: consumes: - multipart/form-data description: 上传用户头像图片,要求用户已登录。 parameters: - description: 头像图片 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/biz.ginResponseAttachment' "400": description: Bad Request schema: $ref: '#/definitions/biz.ginResponse' "401": description: Unauthorized schema: $ref: '#/definitions/biz.ginResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/biz.ginResponse' security: - BearerAuth: [] summary: 上传头像 tags: - attachment /api/v1/upload/banner: post: consumes: - multipart/form-data description: 上传轮播图图片,要求具备上传权限。 parameters: - description: 轮播图图片 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/biz.ginResponseAttachment' "400": description: Bad Request schema: $ref: '#/definitions/biz.ginResponse' "401": description: Unauthorized schema: $ref: '#/definitions/biz.ginResponse' "403": description: Forbidden schema: $ref: '#/definitions/biz.ginResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/biz.ginResponse' security: - BearerAuth: [] summary: 上传轮播图 tags: - attachment /api/v1/upload/category: post: consumes: - multipart/form-data description: 上传文档分类封面图片,要求具备上传权限。 parameters: - description: 分类封面图片 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/biz.ginResponseAttachment' "400": description: Bad Request schema: $ref: '#/definitions/biz.ginResponse' "401": description: Unauthorized schema: $ref: '#/definitions/biz.ginResponse' "403": description: Forbidden schema: $ref: '#/definitions/biz.ginResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/biz.ginResponse' security: - BearerAuth: [] summary: 上传分类封面 tags: - attachment /api/v1/upload/config: post: consumes: - multipart/form-data description: 上传系统配置中使用的图片资源,要求具备上传权限。 parameters: - description: 配置图片 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/biz.ginResponseAttachment' "400": description: Bad Request schema: $ref: '#/definitions/biz.ginResponse' "401": description: Unauthorized schema: $ref: '#/definitions/biz.ginResponse' "403": description: Forbidden schema: $ref: '#/definitions/biz.ginResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/biz.ginResponse' security: - BearerAuth: [] summary: 上传配置图片 tags: - attachment /api/v1/upload/document: post: consumes: - multipart/form-data description: 上传文档文件,要求用户已登录并具备文档上传权限。 parameters: - description: 文档文件 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/biz.ginResponseUploadDocument' "400": description: Bad Request schema: $ref: '#/definitions/biz.ginResponse' "401": description: Unauthorized schema: $ref: '#/definitions/biz.ginResponse' "403": description: Forbidden schema: $ref: '#/definitions/biz.ginResponse' "500": description: Internal Server Error schema: $ref: '#/definitions/biz.ginResponse' security: - BearerAuth: [] summary: 上传文档 tags: - attachment /download/{jwt}: get: description: 根据带签名的 JWT 下载原始文档文件。 parameters: - description: 下载令牌 in: path name: jwt required: true type: string - description: 文档 ID in: query name: document_id required: true type: string - description: 用户 ID in: query name: user_id required: true type: string - description: 下载文件名 in: query name: filename required: true type: string produces: - application/octet-stream responses: "200": description: OK schema: type: file "400": description: Bad Request schema: type: string summary: 下载文档 tags: - attachment /favicon.ico: get: description: 返回当前站点配置的 favicon 文件。 produces: - application/octet-stream responses: "200": description: OK schema: type: file summary: 获取站点 favicon tags: - attachment /view/cover/{hash}: get: description: 读取指定文档的封面图片。 parameters: - description: 文档哈希 in: path name: hash required: true type: string produces: - image/png responses: "200": description: OK schema: type: file "404": description: Not Found schema: additionalProperties: true type: object summary: 获取文档封面 tags: - attachment /view/page/{hash}/{page}: get: description: 读取指定文档分页渲染后的页面资源。 parameters: - description: 文档哈希 in: path name: hash required: true type: string - description: 页码或资源路径 in: path name: page required: true type: string produces: - application/octet-stream responses: "200": description: OK schema: type: file "404": description: Not Found schema: additionalProperties: true type: object summary: 预览文档页面资源 tags: - attachment schemes: - http - https securityDefinitions: BearerAuth: in: header name: Authorization type: apiKey swagger: "2.0"