浏览代码

update

master
DengBiao 2 年前
父节点
当前提交
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 == "" {


正在加载...
取消
保存