Browse Source

update

master
DengBiao 2 years ago
parent
commit
bbfadccd02
2 changed files with 9 additions and 6 deletions
  1. +5
    -4
      internal/logic/api/logic_ext_test.go
  2. +4
    -2
      internal/logic/domain/message/service/app_push.go

+ 5
- 4
internal/logic/api/logic_ext_test.go View File

@@ -26,11 +26,12 @@ func getLogicExtClient() pb.LogicExtClient {
// deprecated: // deprecated:


func getCtx() context.Context { func getCtx() context.Context {
token := "AYBVKGSIFENYDKKOPBYVONZWTCZAQEDGHLAKZLXT"
token := "ICXKTELAGMMJYXITSIOUNXFHYMTCWJHMJCIRZLPX"
return metadata.NewOutgoingContext(context.TODO(), metadata.Pairs( return metadata.NewOutgoingContext(context.TODO(), metadata.Pairs(
"user_id", "13",
"device_id", "10",
"user_id", "2",
"device_id", "5",
"token", token, "token", token,
"master_id", "123456",
"request_id", strconv.FormatInt(time.Now().UnixNano(), 10))) "request_id", strconv.FormatInt(time.Now().UnixNano(), 10)))
} }


@@ -63,7 +64,7 @@ func TestLogicExtServer_SendMessage(t *testing.T) {
resp, err := getLogicExtClient().SendMessage(getCtx(), resp, err := getLogicExtClient().SendMessage(getCtx(),
&pb.SendMessageReq{ &pb.SendMessageReq{
ReceiverType: pb.ReceiverType_RT_USER, ReceiverType: pb.ReceiverType_RT_USER,
ReceiverId: 1,
ReceiverId: 21,
ToUserIds: nil, ToUserIds: nil,
MessageType: pb.MessageType_MT_TEXT, MessageType: pb.MessageType_MT_TEXT,
MessageContent: buf, MessageContent: buf,


+ 4
- 2
internal/logic/domain/message/service/app_push.go View File

@@ -15,6 +15,8 @@ import (
func getChangeContent(args md3.PushParams, Content string) string { func getChangeContent(args md3.PushParams, Content string) string {
Content = strings.Replace(Content, "[MasterId]", args.MasterId, -1) Content = strings.Replace(Content, "[MasterId]", args.MasterId, -1)
Content = strings.Replace(Content, "[消费发送者-会员昵称]", args.SendUserNickname, -1) Content = strings.Replace(Content, "[消费发送者-会员昵称]", args.SendUserNickname, -1)
Content = strings.Replace(Content, "[消费发送者-会员头像]", args.SendUserAvatarUrl, -1)
Content = strings.Replace(Content, "[消息类型]", args.MessageType, -1)
Content = strings.Replace(Content, "[备注]", args.Memo, -1) Content = strings.Replace(Content, "[备注]", args.Memo, -1)
Content = strings.Replace(Content, "[时间]", args.Times, -1) Content = strings.Replace(Content, "[时间]", args.Times, -1)
return Content return Content
@@ -65,15 +67,15 @@ func JgPush(args md3.PushParams) {
Extras: extras, Extras: extras,
} }
send, _, err := jg_push.Send(jgPushAppKey, jgPushAppSecret, param) send, _, err := jg_push.Send(jgPushAppKey, jgPushAppSecret, param)
logger.Logger.Debug("JgPush",
logger.Logger.Debug("JgPush_log",
zap.String("push_alia", args.PushAlia), zap.String("push_alia", args.PushAlia),
zap.String("title", param.Title), zap.String("title", param.Title),
zap.String("content", param.Content), zap.String("content", param.Content),
zap.String("jg_push_app_key", jgPushAppKey), zap.String("jg_push_app_key", jgPushAppKey),
zap.String("jg_push_app_secret", jgPushAppSecret), zap.String("jg_push_app_secret", jgPushAppSecret),
zap.String("err", err.Error()),
) )
if err != nil { if err != nil {
fmt.Println("send_error::::", err)
return return
} }
if send == "" { if send == "" {


Loading…
Cancel
Save