From 1a0c815855064e97cdb66dce0ac917b42e1a35ed Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 28 Nov 2022 22:23:44 +0800 Subject: [PATCH] update --- internal/business/comm/db/db_user_push_for_jg.go | 2 +- internal/logic/domain/message/md/push.go | 2 +- internal/logic/domain/message/service/app_push.go | 15 +++++++++++++++ .../domain/message/service/message_service.go | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/internal/business/comm/db/db_user_push_for_jg.go b/internal/business/comm/db/db_user_push_for_jg.go index 87f4618..422e44e 100644 --- a/internal/business/comm/db/db_user_push_for_jg.go +++ b/internal/business/comm/db/db_user_push_for_jg.go @@ -47,7 +47,7 @@ func (*dbUserPushForJg) UserPushForJgUpdate(uid, masterId int64, pushAlia string // UserPushForJgGetWithDb 单条记录获取 func (*dbUserPushForJg) UserPushForJgGetWithDb(masterId string, HKey string) string { - cacheKey := fmt.Sprintf(md.AppCfgCacheKey, masterId, HKey[0:1]) + cacheKey := fmt.Sprintf(md.AppUserPushForJgCacheKey, masterId, HKey[0:1]) get, err := db.RedisUtil.HGetString(cacheKey, HKey) if err != nil || get == "" { cfg, err := DbUserPushForJg.UserPushForJgGetOne(HKey, utils.StrToInt64(masterId)) diff --git a/internal/logic/domain/message/md/push.go b/internal/logic/domain/message/md/push.go index 26b017b..79f26f9 100644 --- a/internal/logic/domain/message/md/push.go +++ b/internal/logic/domain/message/md/push.go @@ -10,6 +10,6 @@ type PushParams struct { MessageType string `json:"message_type"` //消息类型`UNKNOWN、TEXT、FACE、VOICE、IMAGE、FILE、LOCATION、COMMAND、CUSTOM` SendUserNickname string `json:"send_user_nickname"` //消费发送者-会员昵称 SendUserAvatarUrl string `json:"send_user_avatar_url"` //消费发送者-会员头像 - Memo string `json:"reason"` //备注 + Memo string `json:"memo"` //备注 Times string `json:"times"` //时间 } diff --git a/internal/logic/domain/message/service/app_push.go b/internal/logic/domain/message/service/app_push.go index 3bc3925..034e4ed 100644 --- a/internal/logic/domain/message/service/app_push.go +++ b/internal/logic/domain/message/service/app_push.go @@ -5,6 +5,8 @@ import ( md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_jg_push.git/md" "gim/internal/business/comm/db" md3 "gim/internal/logic/domain/message/md" + "gim/pkg/logger" + "go.uber.org/zap" "strings" ) @@ -19,6 +21,19 @@ func getChangeContent(args md3.PushParams, Content string) string { // CommAddPush 公共处理推送数据 func CommAddPush(args md3.PushParams) { + logger.Logger.Debug("CommAddPush", + zap.String("master_id", args.MasterId), + zap.String("uid", args.Uid), + zap.String("push_alia", args.PushAlia), + zap.String("title", args.Title), + zap.String("content", args.Content), + zap.String("push_type", args.PushType), + zap.String("message_type", args.MessageType), + zap.String("send_user_nickname", args.SendUserNickname), + zap.String("send_user_avatar_url", args.SendUserAvatarUrl), + zap.String("reason", args.Memo), + zap.String("times", args.Times), + ) pushPlatform := db.DbSysCfg.SysCfgFindWithDb(args.MasterId, "app_push_platform")["app_push_platform"] if pushPlatform == "jg" { //极光 args.Content = getChangeContent(args, args.Content) diff --git a/internal/logic/domain/message/service/message_service.go b/internal/logic/domain/message/service/message_service.go index 9b72b6c..ef4d11d 100644 --- a/internal/logic/domain/message/service/message_service.go +++ b/internal/logic/domain/message/service/message_service.go @@ -166,7 +166,7 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser CommAddPush(md.PushParams{ MasterId: masterId, Uid: uid, - PushAlia: "", + PushAlia: alia, Title: "新消息提醒", Content: "", PushType: "zhi_ying_gim",