增加导出-提现记录
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package aliyun
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/hmac"
|
||||
"crypto/sha1"
|
||||
"encoding/base64"
|
||||
@@ -163,3 +164,23 @@ func GetObjectToLocal(filename, local string) (bool, error) {
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// PutObjectByte 上传文件
|
||||
func PutObjectByte(filename string, content []byte) (bool, error) {
|
||||
ossClient, err := CreateClient()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
// yourBucketName填写存储空间名称。
|
||||
bucket, err := ossClient.Bucket(config.C.Oss.OssBucket)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
err = bucket.PutObject(filename, bytes.NewReader(content))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user