feat: add support for Aliyun OSS uploader

This commit is contained in:
yanghao05
2025-04-07 15:15:51 +08:00
parent 753cfde9d5
commit 7308824af8
11 changed files with 252 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import (
"quyun/app/models"
"quyun/database/schemas/public/model"
"quyun/pkg/utils"
"quyun/providers/ali"
"quyun/providers/app"
"github.com/gofiber/fiber/v3"
@@ -20,6 +21,7 @@ import (
// @provider
type uploads struct {
app *app.Config
ali *ali.Config
}
func (up *uploads) storagePath() string {
@@ -137,3 +139,9 @@ func (up *uploads) Complete(ctx fiber.Ctx, md5 string, body *UploadFileInfo) err
return nil
}
// Token
// @Router /v1/admin/uploads/token [get]
func (up *uploads) Token(ctx fiber.Ctx) (*ali.PolicyToken, error) {
return up.ali.GetToken("quyun")
}