payload
This commit is contained in:
parent
354b99c47c
commit
0ab848d838
|
@ -38,6 +38,8 @@ type GetuiMessage struct {
|
|||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue