From 0ab848d838571e85ccff04ba75872c8b4ccc58be Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Thu, 29 Feb 2024 21:00:48 +0800 Subject: [PATCH] payload --- push/getui.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/push/getui.go b/push/getui.go index e2e51c5..5cddd62 100644 --- a/push/getui.go +++ b/push/getui.go @@ -35,9 +35,11 @@ type GetuiDetail struct { } type GetuiMessage struct { - Cid string - Title string - Message string + Cid string + Title string + Message string + NotifyId string + Payload string } type Getui struct { @@ -82,10 +84,9 @@ func (g *Getui) Token() string { params["appkey"] = g.config.AppKey params["sign"] = util.Sha256(signStr) reqBody, _ := json.Marshal(params) - rspBody, err := util.HttpPostJson(reqUrl, nil, reqBody) if err != nil { - log.Errorf("goutil http post error :%s", err.Error()) + fmt.Println(string(reqBody)) return "" } @@ -118,7 +119,9 @@ func (g *Getui) Push(req *GetuiMessage) error { "title": req.Title, "body": req.Message, "channel_level": 4, - "click_type": "startapp", + "click_type": "payload", + "notify_id": cast.ToInt64(req.NotifyId), + "payload": req.Payload, }, } params["push_channel"] = map[string]interface{}{ @@ -128,6 +131,8 @@ func (g *Getui) Push(req *GetuiMessage) error { "title": req.Title, "body": req.Message, "click_type": "startapp", + "notify_id": cast.ToInt64(req.NotifyId), + "payload": req.Payload, }, }, },