Update internal/types/image.go
Browse files- internal/types/image.go +4 -4
internal/types/image.go
CHANGED
@@ -3,7 +3,7 @@ package types
|
|
3 |
import (
|
4 |
"context"
|
5 |
"fmt"
|
6 |
-
|
7 |
"monica-proxy/internal/config"
|
8 |
"monica-proxy/internal/utils"
|
9 |
"net/http"
|
@@ -74,7 +74,7 @@ func UploadBase64Image(ctx context.Context, base64Data string) (*FileInfo, error
|
|
74 |
if err != nil {
|
75 |
return nil, fmt.Errorf("validate image failed: %v", err)
|
76 |
}
|
77 |
-
log.Printf("file info: %+v", fileInfo)
|
78 |
|
79 |
// 5. 获取预签名URL
|
80 |
preSignReq := &PreSignRequest{
|
@@ -99,7 +99,7 @@ func UploadBase64Image(ctx context.Context, base64Data string) (*FileInfo, error
|
|
99 |
if len(preSignResp.Data.PreSignURLList) == 0 || len(preSignResp.Data.ObjectURLList) == 0 {
|
100 |
return nil, fmt.Errorf("no pre-sign url or object url returned")
|
101 |
}
|
102 |
-
log.Printf("preSign info: %+v", preSignResp)
|
103 |
|
104 |
// 6. 上传图片数据
|
105 |
_, err = utils.RestyDefaultClient.R().
|
@@ -129,7 +129,7 @@ func UploadBase64Image(ctx context.Context, base64Data string) (*FileInfo, error
|
|
129 |
if err != nil {
|
130 |
return nil, fmt.Errorf("create file object failed: %v", err)
|
131 |
}
|
132 |
-
log.Printf("uploadResp: %+v", uploadResp)
|
133 |
if len(uploadResp.Data.Items) > 0 {
|
134 |
fileInfo.FileName = uploadResp.Data.Items[0].FileName
|
135 |
fileInfo.FileType = uploadResp.Data.Items[0].FileType
|
|
|
3 |
import (
|
4 |
"context"
|
5 |
"fmt"
|
6 |
+
|
7 |
"monica-proxy/internal/config"
|
8 |
"monica-proxy/internal/utils"
|
9 |
"net/http"
|
|
|
74 |
if err != nil {
|
75 |
return nil, fmt.Errorf("validate image failed: %v", err)
|
76 |
}
|
77 |
+
// log.Printf("file info: %+v", fileInfo)
|
78 |
|
79 |
// 5. 获取预签名URL
|
80 |
preSignReq := &PreSignRequest{
|
|
|
99 |
if len(preSignResp.Data.PreSignURLList) == 0 || len(preSignResp.Data.ObjectURLList) == 0 {
|
100 |
return nil, fmt.Errorf("no pre-sign url or object url returned")
|
101 |
}
|
102 |
+
// log.Printf("preSign info: %+v", preSignResp)
|
103 |
|
104 |
// 6. 上传图片数据
|
105 |
_, err = utils.RestyDefaultClient.R().
|
|
|
129 |
if err != nil {
|
130 |
return nil, fmt.Errorf("create file object failed: %v", err)
|
131 |
}
|
132 |
+
// log.Printf("uploadResp: %+v", uploadResp)
|
133 |
if len(uploadResp.Data.Items) > 0 {
|
134 |
fileInfo.FileName = uploadResp.Data.Items[0].FileName
|
135 |
fileInfo.FileType = uploadResp.Data.Items[0].FileType
|