You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
798 B
38 lines
798 B
package upload
|
|
|
|
import (
|
|
"gin-vue-admin/global"
|
|
"mime/multipart"
|
|
)
|
|
|
|
//@author: [ccfish86](https://github.com/ccfish86)
|
|
//@author: [SliverHorn](https://github.com/SliverHorn)
|
|
//@interface_name: OSS
|
|
//@description: OSS接口
|
|
|
|
type OSS interface {
|
|
UploadFile(file *multipart.FileHeader) (string, string, error)
|
|
DeleteFile(key string) error
|
|
}
|
|
|
|
//@author: [ccfish86](https://github.com/ccfish86)
|
|
//@author: [SliverHorn](https://github.com/SliverHorn)
|
|
//@function: NewOss
|
|
//@description: OSS接口
|
|
//@description: OSS的实例化方法
|
|
//@return: OSS
|
|
|
|
func NewOss() OSS {
|
|
switch global.GVA_CONFIG.System.OssType {
|
|
case "local":
|
|
return &Local{}
|
|
case "qiniu":
|
|
return &Qiniu{}
|
|
case "tencent-cos":
|
|
return &TencentCOS{}
|
|
case "aliyun-cos":
|
|
return &AliyunOSS{}
|
|
default:
|
|
return &Local{}
|
|
}
|
|
}
|