CloudpushNoticeIosRequest.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /**
  3. * TOP API: taobao.cloudpush.notice.ios request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2015.08.10
  7. */
  8. class CloudpushNoticeIosRequest
  9. {
  10. /**
  11. * iOS的通知是通过APNS中心来发送的,需要填写对应的环境信息. DEV:表示开发环境, PRODUCT: 表示生产环境.
  12. **/
  13. private $env;
  14. /**
  15. * 提供给IOS通知的扩展属性,如角标或者声音等,注意:参数值为json
  16. **/
  17. private $ext;
  18. /**
  19. * 通知摘要
  20. **/
  21. private $summary;
  22. /**
  23. * 推送目标: device:推送给设备; account:推送给指定帐号,all: 推送给全部
  24. **/
  25. private $target;
  26. /**
  27. * 根据Target来设定,如Target=device, 则对应的值为 设备id1,设备id2. 多个值使用逗号分隔
  28. **/
  29. private $targetValue;
  30. private $apiParas = array();
  31. public function setEnv($env)
  32. {
  33. $this->env = $env;
  34. $this->apiParas["env"] = $env;
  35. }
  36. public function getEnv()
  37. {
  38. return $this->env;
  39. }
  40. public function setExt($ext)
  41. {
  42. $this->ext = $ext;
  43. $this->apiParas["ext"] = $ext;
  44. }
  45. public function getExt()
  46. {
  47. return $this->ext;
  48. }
  49. public function setSummary($summary)
  50. {
  51. $this->summary = $summary;
  52. $this->apiParas["summary"] = $summary;
  53. }
  54. public function getSummary()
  55. {
  56. return $this->summary;
  57. }
  58. public function setTarget($target)
  59. {
  60. $this->target = $target;
  61. $this->apiParas["target"] = $target;
  62. }
  63. public function getTarget()
  64. {
  65. return $this->target;
  66. }
  67. public function setTargetValue($targetValue)
  68. {
  69. $this->targetValue = $targetValue;
  70. $this->apiParas["target_value"] = $targetValue;
  71. }
  72. public function getTargetValue()
  73. {
  74. return $this->targetValue;
  75. }
  76. public function getApiMethodName()
  77. {
  78. return "taobao.cloudpush.notice.ios";
  79. }
  80. public function getApiParas()
  81. {
  82. return $this->apiParas;
  83. }
  84. public function check()
  85. {
  86. RequestCheckUtil::checkNotNull($this->env,"env");
  87. RequestCheckUtil::checkNotNull($this->summary,"summary");
  88. RequestCheckUtil::checkNotNull($this->target,"target");
  89. RequestCheckUtil::checkNotNull($this->targetValue,"targetValue");
  90. }
  91. public function putOtherTextParam($key, $value) {
  92. $this->apiParas[$key] = $value;
  93. $this->$key = $value;
  94. }
  95. }