PushRequestPath.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zhangdali
  5. * Date: 2016/12/7
  6. * Time: 下午6:30
  7. */
  8. class PushRequestPath {
  9. // regid message
  10. static function V2_SEND() {
  11. return new static("/v2/send", \PushRequestType::MESSAGE);
  12. }
  13. static function V2_REGID_MESSAGE() {
  14. return new static("/v2/message/regid", \PushRequestType::MESSAGE);
  15. }
  16. static function V3_REGID_MESSAGE() {
  17. return new static("/v3/message/regid", \PushRequestType::MESSAGE);
  18. }
  19. // subscribe topic
  20. static function V2_SUBSCRIBE_TOPIC() {
  21. return new static("/v2/topic/subscribe", \PushRequestType::MESSAGE);
  22. }
  23. static function V2_UNSUBSCRIBE_TOPIC() {
  24. return new static("/v2/topic/unsubscribe", \PushRequestType::MESSAGE);
  25. }
  26. static function V2_SUBSCRIBE_TOPIC_BY_ALIAS() {
  27. return new static("/v2/topic/subscribe/alias", \PushRequestType::MESSAGE);
  28. }
  29. static function V2_UNSUBSCRIBE_TOPIC_BY_ALIAS() {
  30. return new static("/v2/topic/unsubscribe/alias", \PushRequestType::MESSAGE);
  31. }
  32. // alias message
  33. static function V2_ALIAS_MESSAGE() {
  34. return new static("/v2/message/alias", \PushRequestType::MESSAGE);
  35. }
  36. static function V3_ALIAS_MESSAGE() {
  37. return new static("/v3/message/alias", \PushRequestType::MESSAGE);
  38. }
  39. // broadcast message
  40. static function V2_BROADCAST_TO_ALL() {
  41. return new static("/v2/message/all", \PushRequestType::MESSAGE);
  42. }
  43. static function V3_BROADCAST_TO_ALL() {
  44. return new static("/v3/message/all", \PushRequestType::MESSAGE);
  45. }
  46. static function V2_BROADCAST() {
  47. return new static("/v2/message/topic", \PushRequestType::MESSAGE);
  48. }
  49. static function V3_BROADCAST() {
  50. return new static("/v3/message/topic", \PushRequestType::MESSAGE);
  51. }
  52. static function V2_MULTI_TOPIC_BROADCAST() {
  53. return new static("/v2/message/multi_topic", \PushRequestType::MESSAGE);
  54. }
  55. static function V3_MILTI_TOPIC_BROADCAST() {
  56. return new static("/v3/message/multi_topic", \PushRequestType::MESSAGE);
  57. }
  58. static function V2_DELETE_BROADCAST_MESSAGE() {
  59. return new static("/v2/message/delete", \PushRequestType::MESSAGE);
  60. }
  61. // user account message
  62. static function V2_USER_ACCOUNT_MESSAGE() {
  63. return new static("/v2/message/user_account", \PushRequestType::MESSAGE);
  64. }
  65. // miid message
  66. static function V2_MIID_MESSAGE() {
  67. return new static("/v2/message/miid", \PushRequestType::MESSAGE);
  68. }
  69. // multi message
  70. static function V2_SEND_MULTI_MESSAGE_WITH_REGID() {
  71. return new self("/v2/multi_messages/regids", \PushRequestType::MESSAGE);
  72. }
  73. static function V2_SEND_MULTI_MESSAGE_WITH_ALIAS() {
  74. return new self("/v2/multi_messages/aliases", \PushRequestType::MESSAGE);
  75. }
  76. static function V2_SEND_MULTI_MESSAGE_WITH_ACCOUNT() {
  77. return new self("/v2/multi_messages/user_accounts", \PushRequestType::MESSAGE);
  78. }
  79. // validate
  80. static function V1_VALIDATE_REGID() {
  81. return new static("/v1/validation/regids", \PushRequestType::MESSAGE);
  82. }
  83. static function V1_GET_ALL_ACCOUNT() {
  84. return new static("/v1/account/all", \PushRequestType::MESSAGE);
  85. }
  86. static function V1_GET_ALL_TOPIC() {
  87. return new static("/v1/topic/all", \PushRequestType::MESSAGE);
  88. }
  89. static function V1_GET_ALL_ALIAS() {
  90. return new static("/v1/alias/all", \PushRequestType::MESSAGE);
  91. }
  92. static function V1_GET_ALL_MIID() {
  93. return new static("/v1/miid/all", \PushRequestType::MESSAGE);
  94. }
  95. // trace
  96. static function V1_MESSAGES_STATUS() {
  97. return new static("/v1/trace/messages/status", \PushRequestType::MESSAGE);
  98. }
  99. static function V1_MESSAGE_STATUS() {
  100. return new static("/v1/trace/message/status", \PushRequestType::MESSAGE);
  101. }
  102. static function V1_GET_MESSAGE_COUNTERS() {
  103. return new static("/v1/stats/message/counters", \PushRequestType::MESSAGE);
  104. }
  105. // presence
  106. static function V1_REGID_PRESENCE() {
  107. return new static("/v1/regid/presence", \PushRequestType::MESSAGE);
  108. }
  109. static function V2_REGID_PRESENCE() {
  110. return new static("/v1/regid/presence", \PushRequestType::MESSAGE);
  111. }
  112. // schedule job
  113. static function V2_DELETE_SCHEDULE_JOB() {
  114. return new static("/v2/schedule_job/delete", \PushRequestType::MESSAGE);
  115. }
  116. static function V3_DELETE_SCHEDULE_JOB() {
  117. return new static("/v3/schedule_job/delete", \PushRequestType::MESSAGE);
  118. }
  119. static function V2_CHECK_SCHEDULE_JOB_EXIST() {
  120. return new static("/v2/schedule_job/exist", \PushRequestType::MESSAGE);
  121. }
  122. static function V2_QUERY_SCHEDULE_JOB() {
  123. return new static("/v2/schedule_job/query", \PushRequestType::MESSAGE);
  124. }
  125. // feedback
  126. static function V1_FEEDBACK_INVALID_ALIAS() {
  127. return new static("/v1/feedback/fetch_invalid_aliases", \PushRequestType::FEEDBACK);
  128. }
  129. static function V1_FEEDBACK_INVALID_REGID() {
  130. return new static("/v1/feedback/fetch_invalid_regids", \PushRequestType::FEEDBACK);
  131. }
  132. static function V1_FEEDBACK_INVALID_MIID() {
  133. return new static("/v1/feedback/fetch_invalid_miid", \PushRequestType::FEEDBACK);
  134. }
  135. // emq job
  136. static function V1_EMQ_ACK_INFO() {
  137. return new static("/msg/ack/info", \PushRequestType::EMQ);
  138. }
  139. static function V1_EMQ_CLICK_INFO() {
  140. return new static("/msg/click/info", \PushRequestType::EMQ);
  141. }
  142. static function V1_EMQ_INVALID_REGID() {
  143. return new static("/app/invalid/regid", \PushRequestType::EMQ);
  144. }
  145. /**
  146. * PushRequestPath constructor.
  147. * @param string $path
  148. * @param int $requestType
  149. */
  150. public function __construct($path, $requestType) {
  151. $this->path = $path;
  152. $this->requestType = $requestType;
  153. }
  154. /**
  155. * @return int
  156. */
  157. public function getRequestType() {
  158. return $this->requestType;
  159. }
  160. /**
  161. * @return string
  162. */
  163. public function getPath() {
  164. return $this->path;
  165. }
  166. /**
  167. * @var string
  168. */
  169. private $path;
  170. /**
  171. * @var int
  172. */
  173. private $requestType;
  174. }