扩展认证逻辑支持 API Token 和动态权限解析,更新配置结构及 Swagger 文档

This commit is contained in:
2026-01-14 16:31:58 +08:00
parent fe656fb298
commit 2ea2c93bb4
13 changed files with 634 additions and 207 deletions

View File

@@ -29,10 +29,11 @@ type UploadResponse struct {
// Upload 上传文件并生成取件码
// @Summary 上传文件
// @Description 上传一个或多个文件并创建一个提取批次
// @Description 上传一个或多个文件并创建一个提取批次。如果配置了 require_token则必须提供带 upload scope 的 API Token。
// @Tags Public
// @Accept multipart/form-data
// @Produce json
// @Security APITokenAuth
// @Param files formData file true "文件列表"
// @Param remark formData string false "备注"
// @Param expire_type formData string false "过期类型 (time/download/permanent)"
@@ -105,10 +106,11 @@ type UploadTextRequest struct {
// UploadText 发送长文本并生成取件码
// @Summary 发送长文本
// @Description 中转一段长文本内容并创建一个提取批次
// @Description 中转一段长文本内容并创建一个提取批次。如果配置了 require_token则必须提供带 upload scope 的 API Token。
// @Tags Public
// @Accept json
// @Produce json
// @Security APITokenAuth
// @Param request body UploadTextRequest true "文本内容及配置"
// @Success 200 {object} model.Response{data=UploadResponse}
// @Failure 400 {object} model.Response