-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathnotice.go
More file actions
48 lines (40 loc) · 1.54 KB
/
notice.go
File metadata and controls
48 lines (40 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 interface{} `json:"alert"`
Sound string `json:"sound,omitempty"`
Badge string `json:"badge,omitempty"`
ContentAvailable bool `json:"content-available,omitempty"`
MutableContent bool `json:"mutable-content,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
}