forked from MobClub/mobpush-websdkv3-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpushmodel.go
39 lines (33 loc) · 1.01 KB
/
pushmodel.go
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
package mob_push_sdk
type Push struct {
WorkNo string `json:"workno"`
Source string `json:"source"`
Appkey string `json:"appkey"`
PushTarget PushTarget `json:"pushTarget"`
PushNotify PushNotify `json:"pushNotify"`
PushOperator *PushOperator `json:"pushOperator,omitempty"`
PushForward *PushForward `json:"pushForward,omitempty"`
}
func NewPushModel(appKey string) *Push {
push := &Push{}
push.Appkey = appKey
push.getDefaultPushModel()
return push
}
func (push *Push) getDefaultPushModel() *Push {
push.Source = "webapi"
push.PushTarget.TagsType = "1"
push.PushNotify.Plats = []int{1, 2}
push.PushNotify.Type = 1
push.PushNotify.IosProduction = 1
push.PushNotify.OfflineSeconds = 3600
//push.PushNotify.AndroidNotify.Warn = "12"
//push.PushNotify.AndroidNotify.Style = 0
//push.PushNotify.IosNotify.Sound = "default"
//push.PushForward.NextType = 0
return push
}
func (push *Push) setWorkno(workno string) *Push {
push.WorkNo = workno
return push
}