pull/218/head
wangchuxiao 3 years ago
parent e0d612c92f
commit 81a6e4b46c

@ -53,8 +53,9 @@ type PushReq struct {
Audience struct { Audience struct {
Cid []string `json:"cid"` Cid []string `json:"cid"`
} `json:"audience"` } `json:"audience"`
PushMssage struct { PushMessage struct {
Notification Notification `json:"notification"` Notification Notification `json:"notification,omitempty"`
Transmission string `json:"transmission,omitempty"`
} `json:"push_message"` } `json:"push_message"`
} }
@ -62,8 +63,8 @@ type Notification struct {
Title string `json:"title"` Title string `json:"title"`
Body string `json:"body"` Body string `json:"body"`
ClickType string `json:"click_type"` ClickType string `json:"click_type"`
Intent string `json:"intent"` //Intent string `json:"intent,omitempty"`
Url string `json:"url"` //Url string `json:"url,omitempty"`
} }
type PushResp struct { type PushResp struct {
@ -96,14 +97,10 @@ func (g *Getui) Push(userIDList []string, alert, detailContent, platform, operat
Cid []string `json:"cid"` Cid []string `json:"cid"`
}{Cid: []string{userIDList[0]}}, }{Cid: []string{userIDList[0]}},
} }
pushReq.PushMssage.Notification = Notification{ pushReq.PushMessage.Notification = Notification{
Title: alert, Title: alert,
Body: alert, Body: alert,
ClickType: "none", ClickType: "startapp",
}
if config.Config.Push.Getui.Intent != "" {
pushReq.PushMssage.Notification.Intent = config.Config.Push.Getui.Intent
pushReq.PushMssage.Notification.ClickType = "intent"
} }
pushResp := PushResp{} pushResp := PushResp{}
err = g.request(PushURL, pushReq, token, &pushResp, operationID) err = g.request(PushURL, pushReq, token, &pushResp, operationID)

Loading…
Cancel
Save