实现图片上传到oss
This commit is contained in:
1
api/gamelife/v1/gamelife.go
Normal file
1
api/gamelife/v1/gamelife.go
Normal file
@ -0,0 +1 @@
|
||||
package v1
|
||||
15
api/upload/upload.go
Normal file
15
api/upload/upload.go
Normal 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
14
api/upload/v1/upload.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user