代码初始化

This commit is contained in:
2026-05-20 11:32:39 +08:00
parent 219b7e39c7
commit e76bf57d54
20 changed files with 1585 additions and 309 deletions

View File

@@ -55,6 +55,15 @@ func SaveUploadedFiles(r *ghttp.Request) ([]string, error) {
return saved, nil
}
// SaveUploadedFilesFromCtx 从请求上下文中获取上传文件并保存
func SaveUploadedFilesFromCtx(ctx context.Context) ([]string, error) {
r := g.RequestFromCtx(ctx)
if r == nil {
return nil, fmt.Errorf("无法获取请求上下文")
}
return SaveUploadedFiles(r)
}
func getTempDir(ctx context.Context) string {
tempDir := g.Cfg().MustGet(ctx, "ffmpeg.temp_dir", "resource/temp").String()
if tempDir == "" {