AlibabaAliqinFcSmsNumSendRequest.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * TOP API: alibaba.aliqin.fc.sms.num.send request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2016.05.24
  7. */
  8. class AlibabaAliqinFcSmsNumSendRequest
  9. {
  10. /**
  11. * 公共回传参数,在“消息返回”中会透传回该参数;举例:用户可以传入自己下级的会员ID,在消息返回时,该会员ID会包含在内,用户可以根据该会员ID识别是哪位会员使用了你的应用
  12. **/
  13. private $extend;
  14. /**
  15. * 短信接收号码。支持单个或多个手机号码,传入号码为11位手机号码,不能加0或+86。群发短信需传入多个号码,以英文逗号分隔,一次调用最多传入200个号码。示例:18600000000,13911111111,13322222222
  16. **/
  17. private $recNum;
  18. /**
  19. * 短信签名,传入的短信签名必须是在阿里大鱼“管理中心-短信签名管理”中的可用签名。如“阿里大鱼”已在短信签名管理中通过审核,则可传入”阿里大鱼“(传参时去掉引号)作为短信签名。短信效果示例:【阿里大鱼】欢迎使用阿里大鱼服务。
  20. **/
  21. private $smsFreeSignName;
  22. /**
  23. * 短信模板变量,传参规则{"key":"value"},key的名字须和申请模板中的变量名一致,多个变量之间以逗号隔开。示例:针对模板“验证码${code},您正在进行${product}身份验证,打死不要告诉别人哦!”,传参时需传入{"code":"1234","product":"alidayu"}
  24. **/
  25. private $smsParam;
  26. /**
  27. * 短信模板ID,传入的模板必须是在阿里大鱼“管理中心-短信模板管理”中的可用模板。示例:SMS_585014
  28. **/
  29. private $smsTemplateCode;
  30. /**
  31. * 短信类型,传入值请填写normal
  32. **/
  33. private $smsType;
  34. private $apiParas = array();
  35. public function setExtend($extend)
  36. {
  37. $this->extend = $extend;
  38. $this->apiParas["extend"] = $extend;
  39. }
  40. public function getExtend()
  41. {
  42. return $this->extend;
  43. }
  44. public function setRecNum($recNum)
  45. {
  46. $this->recNum = $recNum;
  47. $this->apiParas["rec_num"] = $recNum;
  48. }
  49. public function getRecNum()
  50. {
  51. return $this->recNum;
  52. }
  53. public function setSmsFreeSignName($smsFreeSignName)
  54. {
  55. $this->smsFreeSignName = $smsFreeSignName;
  56. $this->apiParas["sms_free_sign_name"] = $smsFreeSignName;
  57. }
  58. public function getSmsFreeSignName()
  59. {
  60. return $this->smsFreeSignName;
  61. }
  62. public function setSmsParam($smsParam)
  63. {
  64. $this->smsParam = $smsParam;
  65. $this->apiParas["sms_param"] = $smsParam;
  66. }
  67. public function getSmsParam()
  68. {
  69. return $this->smsParam;
  70. }
  71. public function setSmsTemplateCode($smsTemplateCode)
  72. {
  73. $this->smsTemplateCode = $smsTemplateCode;
  74. $this->apiParas["sms_template_code"] = $smsTemplateCode;
  75. }
  76. public function getSmsTemplateCode()
  77. {
  78. return $this->smsTemplateCode;
  79. }
  80. public function setSmsType($smsType)
  81. {
  82. $this->smsType = $smsType;
  83. $this->apiParas["sms_type"] = $smsType;
  84. }
  85. public function getSmsType()
  86. {
  87. return $this->smsType;
  88. }
  89. public function getApiMethodName()
  90. {
  91. return "alibaba.aliqin.fc.sms.num.send";
  92. }
  93. public function getApiParas()
  94. {
  95. return $this->apiParas;
  96. }
  97. public function check()
  98. {
  99. RequestCheckUtil::checkNotNull($this->recNum,"recNum");
  100. RequestCheckUtil::checkNotNull($this->smsFreeSignName,"smsFreeSignName");
  101. RequestCheckUtil::checkNotNull($this->smsTemplateCode,"smsTemplateCode");
  102. RequestCheckUtil::checkNotNull($this->smsType,"smsType");
  103. }
  104. public function putOtherTextParam($key, $value) {
  105. $this->apiParas[$key] = $value;
  106. $this->$key = $value;
  107. }
  108. }