payload
This commit is contained in:
parent
354b99c47c
commit
0ab848d838
|
@ -35,9 +35,11 @@ type GetuiDetail struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetuiMessage struct {
|
type GetuiMessage struct {
|
||||||
Cid string
|
Cid string
|
||||||
Title string
|
Title string
|
||||||
Message string
|
Message string
|
||||||
|
NotifyId string
|
||||||
|
Payload string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Getui struct {
|
type Getui struct {
|
||||||
|
@ -82,10 +84,9 @@ func (g *Getui) Token() string {
|
||||||
params["appkey"] = g.config.AppKey
|
params["appkey"] = g.config.AppKey
|
||||||
params["sign"] = util.Sha256(signStr)
|
params["sign"] = util.Sha256(signStr)
|
||||||
reqBody, _ := json.Marshal(params)
|
reqBody, _ := json.Marshal(params)
|
||||||
|
|
||||||
rspBody, err := util.HttpPostJson(reqUrl, nil, reqBody)
|
rspBody, err := util.HttpPostJson(reqUrl, nil, reqBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("goutil http post error :%s", err.Error())
|
fmt.Println(string(reqBody))
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +119,9 @@ func (g *Getui) Push(req *GetuiMessage) error {
|
||||||
"title": req.Title,
|
"title": req.Title,
|
||||||
"body": req.Message,
|
"body": req.Message,
|
||||||
"channel_level": 4,
|
"channel_level": 4,
|
||||||
"click_type": "startapp",
|
"click_type": "payload",
|
||||||
|
"notify_id": cast.ToInt64(req.NotifyId),
|
||||||
|
"payload": req.Payload,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
params["push_channel"] = map[string]interface{}{
|
params["push_channel"] = map[string]interface{}{
|
||||||
|
@ -128,6 +131,8 @@ func (g *Getui) Push(req *GetuiMessage) error {
|
||||||
"title": req.Title,
|
"title": req.Title,
|
||||||
"body": req.Message,
|
"body": req.Message,
|
||||||
"click_type": "startapp",
|
"click_type": "startapp",
|
||||||
|
"notify_id": cast.ToInt64(req.NotifyId),
|
||||||
|
"payload": req.Payload,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue