constant.go 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package mi
  2. // Xiaomi push service document: https://dev.mi.com/doc/cat=35/index.html
  3. const (
  4. // VipHost VIP host.
  5. VipHost = "https://vip.api.xmpush.xiaomi.com"
  6. // DevHost dev host.
  7. DevHost = "https://sandbox.xmpush.xiaomi.com"
  8. // ProductionHost production host.
  9. ProductionHost = "https://api.xmpush.xiaomi.com"
  10. // feedbackHost host to get invalid token.
  11. feedbackHost = "https://feedback.xmpush.xiaomi.com"
  12. // emqHost message queue
  13. emqHost = "https://emq.xmpush.xiaomi.com"
  14. // AuthPrefix auth prefix.
  15. AuthPrefix = "key="
  16. // ResultOk result status.
  17. ResultOk = "ok" // "ok" means success, "error" means failed.
  18. // ResultError result status.
  19. ResultError = "error"
  20. // ResultCodeOk result status code.
  21. ResultCodeOk = 0
  22. // ResultCodeNoValidTargets no valid token.
  23. ResultCodeNoValidTargets = 20301
  24. // ResultCodeNoMsgInEmq no message in emq.
  25. ResultCodeNoMsgInEmq = 80002
  26. // RegURL 向某个regid或一组regid列表推送某条消息
  27. RegURL = "/v3/message/regid"
  28. // AccountURL 根据account,发送消息到指定account上
  29. AccountURL = "/v2/message/user_account"
  30. // MultiRegIDURL 针对不同的regid推送不同的消息
  31. MultiRegIDURL = "/v2/multi_messages/regids"
  32. // MultiAliasURL 针对不同的aliases推送不同的消息
  33. MultiAliasURL = "/v2/multi_messages/aliases"
  34. // MultiUserAccountURL 针对不同的accounts推送不同的消息
  35. MultiUserAccountURL = "/v2/multi_messages/user_accounts"
  36. // AliasURL 根据alias,发送消息到指定设备上
  37. AliasURL = "/v3/message/alias"
  38. // MultiPackageNameMultiTopicURL 根据topic,发送消息到指定一组设备上
  39. MultiPackageNameMultiTopicURL = "/v3/message/multi_topic"
  40. // MultiTopicURL 根据topic,发送消息到指定一组设备上
  41. MultiTopicURL = "/v2/message/topic"
  42. // MultiPackageNameAllURL 向所有设备推送某条消息
  43. MultiPackageNameAllURL = "/v3/message/all"
  44. // AllURL 向所有设备推送某条消息
  45. AllURL = "/v2/message/all"
  46. // TopicURL 向多个topic广播消息
  47. TopicURL = "/v3/message/multi_topic"
  48. // ScheduleJobExistURL 检测定时消息的任务是否存在
  49. ScheduleJobExistURL = "/v2/schedule_job/exist"
  50. // ScheduleJobDeleteURL 删除指定的定时消息
  51. ScheduleJobDeleteURL = "/v2/schedule_job/delete"
  52. // ScheduleJobDeleteByJobKeyURL 删除指定的定时消息
  53. ScheduleJobDeleteByJobKeyURL = "/v3/schedule_job/delete"
  54. // feedbackURI 获取无效token列表
  55. feedbackURI = "/v1/feedback/fetch_invalid_regids"
  56. // uninstalledURI 获取卸载token列表
  57. uninstalledURI = "/app/uninstall/regid"
  58. // StatusURL 追踪消息
  59. StatusURL = "/v1/trace/message/status"
  60. // NotifyTypeDefaultAll 包括下面三种(notify type 可以是以下几种的OR组合)
  61. NotifyTypeDefaultAll = -1
  62. // NotifyTypeDefaultNone 声音、振动、led灯全关
  63. NotifyTypeDefaultNone = 0
  64. // NotifyTypeDefaultSound 使用默认提示音提示
  65. NotifyTypeDefaultSound = 1
  66. // NotifyTypeDefaultVibration 使用默认震动提示
  67. NotifyTypeDefaultVibration = 2
  68. // NotifyTypeDefaultLight 使用默认led灯光提示
  69. NotifyTypeDefaultLight = 4
  70. // NotPassThrough 显示通知
  71. NotPassThrough = 0
  72. // PassThrough 静默推送
  73. PassThrough = 1
  74. // CallbackURL 客户端收到后回调
  75. CallbackURL = "https://api.bilibili.com/x/push/callback/xiaomi"
  76. // CallbackBarStatusEnable .
  77. CallbackBarStatusEnable = 1
  78. // CallbackBarStatusDisable .
  79. CallbackBarStatusDisable = 2
  80. // CallbackBarStatusUnknown .
  81. CallbackBarStatusUnknown = 3
  82. // CallbackBarStatusEnableStr .
  83. CallbackBarStatusEnableStr = "Enable"
  84. // CallbackBarStatusDisableStr .
  85. CallbackBarStatusDisableStr = "Disable"
  86. // CallbackBarStatusUnknownStr .
  87. CallbackBarStatusUnknownStr = "Unknown"
  88. )