Initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 10:47:18 +08:00
co-authored by Claude Opus 4.7
commit 79ac89b458
708 changed files with 151634 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package storage
import (
"bytes"
"context"
"errors"
"mime/multipart"
"videoweb/pub/storage/proxy"
)
// web后台上传使用, form-data方式上传
func UploadImage(ctx context.Context, f *multipart.FileHeader, domain string) (path string, err error) {
if f == nil {
return "", errors.New("file is nil!")
}
var file multipart.File
if file, err = f.Open(); err != nil {
return
}
defer file.Close()
//mtx.Lock()
//defer mtx.Unlock()
buffer := bytes.Buffer{}
if _, err = buffer.ReadFrom(file); err != nil {
return
}
return proxy.UploadImg(f.Filename, buffer.Bytes(), domain)
}
func QueryMedias(ctx context.Context, in *proxy.MediaQueryesReq, domain string) (*proxy.VideoQuerysResult, error) {
return proxy.QueryMedias(in, domain)
}