mirror of
https://github.com/wahyd4/jpush-api-go-client.git
synced 2026-08-09 12:56:33 +10:00
48 lines
1.5 KiB
Go
48 lines
1.5 KiB
Go
package jpushclient
|
|
|
|
type Notice struct {
|
|
Alert string `json:"alert,omitempty"`
|
|
Android *AndroidNotice `json:"android,omitempty"`
|
|
IOS *IOSNotice `json:"ios,omitempty"`
|
|
WINPhone *WinPhoneNotice `json:"winphone,omitempty"`
|
|
}
|
|
|
|
type AndroidNotice struct {
|
|
Alert string `json:"alert"`
|
|
Title string `json:"title,omitempty"`
|
|
BuilderId int `json:"builder_id,omitempty"`
|
|
Extras map[string]interface{} `json:"extras,omitempty"`
|
|
}
|
|
|
|
type IOSNotice struct {
|
|
Alert string `json:"alert"`
|
|
Sound string `json:"sound,omitempty"`
|
|
Badge int `json:"badge,omitempty"`
|
|
ContentAvailable bool `json:"Content-available,omitempty"`
|
|
Category string `json:"category,omitempty"`
|
|
Extras map[string]interface{} `json:"extras,omitempty"`
|
|
}
|
|
|
|
type WinPhoneNotice struct {
|
|
Alert string `json:"alert"`
|
|
Title string `json:"title,omitempty"`
|
|
OpenPage string `json:"_open_page,omitempty"`
|
|
Extras map[string]interface{} `json:"extras,omitempty"`
|
|
}
|
|
|
|
func (this *Notice) SetAlert(alert string) {
|
|
this.Alert = alert
|
|
}
|
|
|
|
func (this *Notice) SetAndroidNotice(n *AndroidNotice) {
|
|
this.Android = n
|
|
}
|
|
|
|
func (this *Notice) SetIOSNotice(n *IOSNotice) {
|
|
this.IOS = n
|
|
}
|
|
|
|
func (this *Notice) SetWinPhoneNotice(n *WinPhoneNotice) {
|
|
this.WINPhone = n
|
|
}
|