实现图片上传到oss

This commit is contained in:
2025-06-06 10:24:49 +08:00
parent 830f9c236b
commit ffc01164f7
12 changed files with 176 additions and 0 deletions

View File

@ -0,0 +1 @@
package v1

15
api/upload/upload.go Normal file
View File

@ -0,0 +1,15 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package upload
import (
"context"
"server/api/upload/v1"
)
type IUploadV1 interface {
Upload(ctx context.Context, req *v1.UploadReq) (res *v1.UploadRes, err error)
}

14
api/upload/v1/upload.go Normal file
View File

@ -0,0 +1,14 @@
package v1
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
)
type UploadReq struct {
g.Meta `path:"/upload/image" method:"post" tags:"WEB" summary:"上传文件"`
File *ghttp.UploadFile `json:"file"`
}
type UploadRes struct {
Url string `json:"url"`
}