notice.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package jpushclient
  2. type Notice struct {
  3. Alert string `json:"alert,omitempty"`
  4. Android *AndroidNotice `json:"android,omitempty"`
  5. IOS *IOSNotice `json:"ios,omitempty"`
  6. WINPhone *WinPhoneNotice `json:"winphone,omitempty"`
  7. }
  8. type AndroidNotice struct {
  9. Alert string `json:"alert"`
  10. Title string `json:"title,omitempty"`
  11. BuilderId int `json:"builder_id,omitempty"`
  12. Extras map[string]interface{} `json:"extras,omitempty"`
  13. }
  14. type IOSNotice struct {
  15. Alert interface{} `json:"alert"`
  16. Sound string `json:"sound,omitempty"`
  17. Badge string `json:"badge,omitempty"`
  18. ContentAvailable bool `json:"content-available,omitempty"`
  19. MutableContent bool `json:"mutable-content,omitempty"`
  20. Category string `json:"category,omitempty"`
  21. Extras map[string]interface{} `json:"extras,omitempty"`
  22. }
  23. type WinPhoneNotice struct {
  24. Alert string `json:"alert"`
  25. Title string `json:"title,omitempty"`
  26. OpenPage string `json:"_open_page,omitempty"`
  27. Extras map[string]interface{} `json:"extras,omitempty"`
  28. }
  29. func (this *Notice) SetAlert(alert string) {
  30. this.Alert = alert
  31. }
  32. func (this *Notice) SetAndroidNotice(n *AndroidNotice) {
  33. this.Android = n
  34. }
  35. func (this *Notice) SetIOSNotice(n *IOSNotice) {
  36. this.IOS = n
  37. }
  38. func (this *Notice) SetWinPhoneNotice(n *WinPhoneNotice) {
  39. this.WINPhone = n
  40. }