notice.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // NoticeCondition NoticeCondition
  6. type NoticeCondition uint8
  7. // NoticeStatus NoticeStatus
  8. type NoticeStatus uint8
  9. // NoticePlat NoticePlat
  10. type NoticePlat uint8
  11. const (
  12. // PlatUnknow PlatUnknow
  13. PlatUnknow NoticePlat = 0
  14. // PlatWeb PlatUnknow
  15. PlatWeb NoticePlat = 1
  16. // PlatAndroid PlatAndroid
  17. PlatAndroid NoticePlat = 2
  18. // PlatIPhone PlatIPhone
  19. PlatIPhone NoticePlat = 3
  20. // PlatWpM wp mobile
  21. PlatWpM NoticePlat = 4
  22. // PlatIPad PlatIPad
  23. PlatIPad NoticePlat = 5
  24. // PlatPadHd ipad hd
  25. PlatPadHd NoticePlat = 6
  26. // PlatWpPc win10
  27. PlatWpPc NoticePlat = 7
  28. )
  29. const (
  30. // StatusOffline StatusOffline
  31. StatusOffline NoticeStatus = 0
  32. // StatusOnline StatusOnline
  33. StatusOnline NoticeStatus = 1
  34. )
  35. const (
  36. // ConditionEQ ConditionEQ
  37. ConditionEQ NoticeCondition = 0 // condition equal
  38. // ConditionGT ConditionGT
  39. ConditionGT NoticeCondition = 1 // greater
  40. // ConditionLT ConditionLT
  41. ConditionLT NoticeCondition = 2 // less
  42. )
  43. // Notice reply's public notice
  44. type Notice struct {
  45. ID uint32 `json:"id"`
  46. Plat NoticePlat `json:"plat"`
  47. Version string `json:"version"`
  48. Condition NoticeCondition `json:"condi"`
  49. Build uint32 `json:"build"`
  50. Title string `json:"title"`
  51. Content string `json:"content"`
  52. Link string `json:"link"`
  53. StartTime xtime.Time `json:"stime"`
  54. EndTime xtime.Time `json:"etime"`
  55. Status NoticeStatus `json:"status"`
  56. CreateTime xtime.Time `json:"ctime"`
  57. ModifyTime xtime.Time `json:"mtime"`
  58. //client's program type
  59. ClientType string `json:"client_type"`
  60. }