DengBiao 2 лет назад
Родитель
Сommit
bbfadccd02
2 измененных файлов: 9 добавлений и 6 удалений
  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 Просмотреть файл

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

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

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


+ 4
- 2
internal/logic/domain/message/service/app_push.go Просмотреть файл

@@ -15,6 +15,8 @@ import (
func getChangeContent(args md3.PushParams, Content string) string {
Content = strings.Replace(Content, "[MasterId]", args.MasterId, -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.Times, -1)
return Content
@@ -65,15 +67,15 @@ func JgPush(args md3.PushParams) {
Extras: extras,
}
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("title", param.Title),
zap.String("content", param.Content),
zap.String("jg_push_app_key", jgPushAppKey),
zap.String("jg_push_app_secret", jgPushAppSecret),
zap.String("err", err.Error()),
)
if err != nil {
fmt.Println("send_error::::", err)
return
}
if send == "" {


Загрузка…
Отмена
Сохранить