feat:fix go mod
This commit is contained in:
@@ -2,11 +2,12 @@ package upload
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"gin-vue-admin/global"
|
||||
"github.com/aliyun/aliyun-oss-go-sdk/oss"
|
||||
"go.uber.org/zap"
|
||||
"mime/multipart"
|
||||
"time"
|
||||
|
||||
"github.com/aliyun/aliyun-oss-go-sdk/oss"
|
||||
"github.com/flipped-aurora/gin-vue-admin/global"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type AliyunOSS struct{}
|
||||
|
@@ -2,15 +2,16 @@ package upload
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/utils"
|
||||
"go.uber.org/zap"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/flipped-aurora/gin-vue-admin/global"
|
||||
"github.com/flipped-aurora/gin-vue-admin/utils"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type Local struct{}
|
||||
|
@@ -4,12 +4,13 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-vue-admin/global"
|
||||
"mime/multipart"
|
||||
"time"
|
||||
|
||||
"github.com/flipped-aurora/gin-vue-admin/global"
|
||||
"github.com/qiniu/api.v7/v7/auth/qbox"
|
||||
"github.com/qiniu/api.v7/v7/storage"
|
||||
"go.uber.org/zap"
|
||||
"mime/multipart"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Qiniu struct{}
|
||||
@@ -38,7 +39,7 @@ func (*Qiniu) UploadFile(file *multipart.FileHeader) (string, string, error) {
|
||||
|
||||
return "", "", errors.New("function file.Open() Filed, err:" + openError.Error())
|
||||
}
|
||||
defer f.Close() // 创建文件 defer 关闭
|
||||
defer f.Close() // 创建文件 defer 关闭
|
||||
fileKey := fmt.Sprintf("%d%s", time.Now().Unix(), file.Filename) // 文件名格式 自己可以改 建议保证唯一性
|
||||
putErr := formUploader.Put(context.Background(), &ret, upToken, fileKey, f, file.Size, &putExtra)
|
||||
if putErr != nil {
|
||||
|
@@ -4,12 +4,13 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-vue-admin/global"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/flipped-aurora/gin-vue-admin/global"
|
||||
|
||||
"github.com/tencentyun/cos-go-sdk-v5"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@@ -1,8 +1,9 @@
|
||||
package upload
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"mime/multipart"
|
||||
|
||||
"github.com/flipped-aurora/gin-vue-admin/global"
|
||||
)
|
||||
|
||||
//@author: [ccfish86](https://github.com/ccfish86)
|
||||
|
Reference in New Issue
Block a user