docs(api): 补全 OpenAPI 上传与系统设置文档

为文件上传、静态资源和文件存储设置接口补齐注释,并同步更新生成的 Swagger 文档。
This commit is contained in:
2026-05-15 09:59:25 +08:00
parent 62d426bdfb
commit 34c3251c6d
6 changed files with 1300 additions and 0 deletions
@@ -9,10 +9,28 @@ import (
"github.com/easyai/easyai-ai-gateway/apps/api/internal/config"
)
// serveGeneratedStaticAsset godoc
// @Summary 获取本地生成资源
// @Description 从本地生成资源目录读取图片、视频等任务产物;不存在时返回 404。
// @Tags static
// @Produce octet-stream
// @Param asset path string true "资源文件名"
// @Success 200 {file} file
// @Failure 404 {string} string "Not Found"
// @Router /static/generated/{asset} [get]
func (s *Server) serveGeneratedStaticAsset(w http.ResponseWriter, r *http.Request) {
s.serveLocalStaticAsset(w, r, s.cfg.LocalGeneratedStorageDir, config.DefaultLocalGeneratedStorageDir)
}
// serveUploadedStaticAsset godoc
// @Summary 获取本地上传资源
// @Description 从本地上传资源目录读取用户上传文件;不存在时返回 404。
// @Tags static
// @Produce octet-stream
// @Param asset path string true "资源文件名"
// @Success 200 {file} file
// @Failure 404 {string} string "Not Found"
// @Router /static/uploaded/{asset} [get]
func (s *Server) serveUploadedStaticAsset(w http.ResponseWriter, r *http.Request) {
s.serveLocalStaticAsset(w, r, s.cfg.LocalUploadedStorageDir, config.DefaultLocalUploadedStorageDir)
}