From 9ccd84abddd7431fb62100b979969d845df07521 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 23 Aug 2023 11:23:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A3=81=E5=89=AA=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/logic/logocombinelogic.go | 28 +++++++++---------- service/repositories/image_handle.go | 5 +++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/server/resource/internal/logic/logocombinelogic.go b/server/resource/internal/logic/logocombinelogic.go index 53b02768..4679ee5e 100644 --- a/server/resource/internal/logic/logocombinelogic.go +++ b/server/resource/internal/logic/logocombinelogic.go @@ -45,22 +45,22 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth return resp.SetStatus(basic.CodeUnAuth) } - var userId int64 - var guestId int64 + // var userId int64 + // var guestId int64 - // 检查用户是否是游客 - if userinfo.IsGuest() { - // 如果是,使用游客ID和游客键名格式 - guestId = userinfo.GuestId - } else { - // 否则,使用用户ID和用户键名格式 - userId = userinfo.UserId - } + // // 检查用户是否是游客 + // if userinfo.IsGuest() { + // // 如果是,使用游客ID和游客键名格式 + // guestId = userinfo.GuestId + // } else { + // // 否则,使用用户ID和用户键名格式 + // userId = userinfo.UserId + // } res, err := l.svcCtx.Repositories.ImageHandle.LogoCombine(l.ctx, &repositories.LogoCombineReq{ - UserId: userId, - GuestId: guestId, - TemplateId: req.TemplateId, - TemplateTag: req.TemplateTag, + UserId: 0, + GuestId: 36, + TemplateId: 569, + TemplateTag: "b1a", Website: req.Website, Slogan: req.Slogan, Phone: req.Phone, diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 75fbbf53..28ee5061 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -96,6 +96,7 @@ type ( func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq) (*LogoCombineRes, error) { // 查询logo最新基础信息 var metadata *string + var logoUrl *string userMaterialModel := gmodel.NewFsUserMaterialModel(l.MysqlConn) userMaterialInfo, err := userMaterialModel.FindLatestOne(ctx, in.UserId, in.GuestId) @@ -107,19 +108,21 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq return nil, err } metadata = userMaterialInfoDefault.Metadata + logoUrl = userMaterialInfoDefault.ResourceUrl } else { logx.Error(err) return nil, err } } else { metadata = userMaterialInfo.Metadata + logoUrl = userMaterialInfo.ResourceUrl } // 根据hash 查询数据资源 var hashKeyData = *in hashKeyData.GuestId = 0 hashKeyData.UserId = 0 - hashKeyData.LogoUrl = *userMaterialInfo.ResourceUrl + hashKeyData.LogoUrl = *logoUrl var hashKeyDataMap map[string]interface{} hashKeyDataB, _ := json.Marshal(hashKeyData) json.Unmarshal(hashKeyDataB, &hashKeyDataMap)