From dcc3cc4a7d089e2f77af74576cf384399e715648 Mon Sep 17 00:00:00 2001 From: Hiven Date: Mon, 7 Aug 2023 19:51:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upload/internal/logic/uploadfilebaselogic.go | 9 ++++++--- server/upload/internal/logic/uploadlogologic.go | 14 +++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/server/upload/internal/logic/uploadfilebaselogic.go b/server/upload/internal/logic/uploadfilebaselogic.go index 2b1f5d93..dbb0be24 100644 --- a/server/upload/internal/logic/uploadfilebaselogic.go +++ b/server/upload/internal/logic/uploadfilebaselogic.go @@ -61,9 +61,12 @@ func (l *UploadFileBaseLogic) UploadFileBase(req *types.UploadFileBaseReq, useri userId = userinfo.UserId uid = userId } - - guestId = req.GuestId - userId = req.UserId + if guestId == 0 { + guestId = req.GuestId + } + if userId == 0 { + userId = req.UserId + } // 定义存储桶名称 var bucketName *string diff --git a/server/upload/internal/logic/uploadlogologic.go b/server/upload/internal/logic/uploadlogologic.go index 99084502..f9babfb8 100644 --- a/server/upload/internal/logic/uploadlogologic.go +++ b/server/upload/internal/logic/uploadlogologic.go @@ -110,12 +110,16 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us // } // resultStr = string(b) - // 上传图片 - var reqs types.UploadFileBaseReq - // reqs.FileType = + // // 上传图片 + // var reqs types.UploadFileBaseReq + // reqs.ApiType = 2 + // reqs.UploadBucket = 2 + // reqs.Metadata = "" + // reqs.FileData = "" + // reqs.FileKey = "" - // 创建一个业务逻辑层实例 - NewUploadFileBaseLogic(l.ctx, l.svcCtx).UploadFileBase(&reqs, userinfo) + // // 创建一个业务逻辑层实例 + // resUpload := NewUploadFileBaseLogic(l.ctx, l.svcCtx).UploadFileBase(&reqs, userinfo) var module = "logo" var nowTime = time.Now().Unix()