@@ -47,7 +47,7 @@ func (*dbUserPushForJg) UserPushForJgUpdate(uid, masterId int64, pushAlia string | |||||
// UserPushForJgGetWithDb 单条记录获取 | // UserPushForJgGetWithDb 单条记录获取 | ||||
func (*dbUserPushForJg) UserPushForJgGetWithDb(masterId string, HKey string) string { | 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) | get, err := db.RedisUtil.HGetString(cacheKey, HKey) | ||||
if err != nil || get == "" { | if err != nil || get == "" { | ||||
cfg, err := DbUserPushForJg.UserPushForJgGetOne(HKey, utils.StrToInt64(masterId)) | cfg, err := DbUserPushForJg.UserPushForJgGetOne(HKey, utils.StrToInt64(masterId)) | ||||
@@ -10,6 +10,6 @@ type PushParams struct { | |||||
MessageType string `json:"message_type"` //消息类型`UNKNOWN、TEXT、FACE、VOICE、IMAGE、FILE、LOCATION、COMMAND、CUSTOM` | MessageType string `json:"message_type"` //消息类型`UNKNOWN、TEXT、FACE、VOICE、IMAGE、FILE、LOCATION、COMMAND、CUSTOM` | ||||
SendUserNickname string `json:"send_user_nickname"` //消费发送者-会员昵称 | SendUserNickname string `json:"send_user_nickname"` //消费发送者-会员昵称 | ||||
SendUserAvatarUrl string `json:"send_user_avatar_url"` //消费发送者-会员头像 | SendUserAvatarUrl string `json:"send_user_avatar_url"` //消费发送者-会员头像 | ||||
Memo string `json:"reason"` //备注 | |||||
Memo string `json:"memo"` //备注 | |||||
Times string `json:"times"` //时间 | Times string `json:"times"` //时间 | ||||
} | } |
@@ -5,6 +5,8 @@ import ( | |||||
md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_jg_push.git/md" | md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_jg_push.git/md" | ||||
"gim/internal/business/comm/db" | "gim/internal/business/comm/db" | ||||
md3 "gim/internal/logic/domain/message/md" | md3 "gim/internal/logic/domain/message/md" | ||||
"gim/pkg/logger" | |||||
"go.uber.org/zap" | |||||
"strings" | "strings" | ||||
) | ) | ||||
@@ -19,6 +21,19 @@ func getChangeContent(args md3.PushParams, Content string) string { | |||||
// CommAddPush 公共处理推送数据 | // CommAddPush 公共处理推送数据 | ||||
func CommAddPush(args md3.PushParams) { | 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"] | pushPlatform := db.DbSysCfg.SysCfgFindWithDb(args.MasterId, "app_push_platform")["app_push_platform"] | ||||
if pushPlatform == "jg" { //极光 | if pushPlatform == "jg" { //极光 | ||||
args.Content = getChangeContent(args, args.Content) | args.Content = getChangeContent(args, args.Content) | ||||
@@ -166,7 +166,7 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser | |||||
CommAddPush(md.PushParams{ | CommAddPush(md.PushParams{ | ||||
MasterId: masterId, | MasterId: masterId, | ||||
Uid: uid, | Uid: uid, | ||||
PushAlia: "", | |||||
PushAlia: alia, | |||||
Title: "新消息提醒", | Title: "新消息提醒", | ||||
Content: "", | Content: "", | ||||
PushType: "zhi_ying_gim", | PushType: "zhi_ying_gim", | ||||