AlibabaAliqinFcIotSmsSendRequest.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. /**
  3. * TOP API: alibaba.aliqin.fc.iot.sms.send request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2017.11.13
  7. */
  8. class AlibabaAliqinFcIotSmsSendRequest
  9. {
  10. /**
  11. * 公共回传参数,在“消息返回”中会透传回该参数;举例:用户可以传入自己下级的会员ID,在消息返回时,该会员ID会包含在内,用户可以根据该会员ID识别是哪位会员使用了你的应用
  12. **/
  13. private $extend;
  14. /**
  15. * 短信接收号码。
  16. **/
  17. private $recNum;
  18. /**
  19. * 短信模板变量,传参规则{"key":"value"},key的名字须和申请模板中的变量名一致,多个变量之间以逗号隔开。示例:针对模板“验证码${code},您正在进行${product}身份验证,打死不要告诉别人哦!”,传参时需传入{"code":"1234","product":"alidayu"}
  20. **/
  21. private $smsParam;
  22. /**
  23. * 短信模板ID,传入的模板必须是在阿里大于“管理中心-短信模板管理”中的可用模板。示例:SMS_585014
  24. **/
  25. private $smsTemplateCode;
  26. /**
  27. * 短信类型,传入值请填写normal
  28. **/
  29. private $smsType;
  30. private $apiParas = array();
  31. public function setExtend($extend)
  32. {
  33. $this->extend = $extend;
  34. $this->apiParas["extend"] = $extend;
  35. }
  36. public function getExtend()
  37. {
  38. return $this->extend;
  39. }
  40. public function setRecNum($recNum)
  41. {
  42. $this->recNum = $recNum;
  43. $this->apiParas["rec_num"] = $recNum;
  44. }
  45. public function getRecNum()
  46. {
  47. return $this->recNum;
  48. }
  49. public function setSmsParam($smsParam)
  50. {
  51. $this->smsParam = $smsParam;
  52. $this->apiParas["sms_param"] = $smsParam;
  53. }
  54. public function getSmsParam()
  55. {
  56. return $this->smsParam;
  57. }
  58. public function setSmsTemplateCode($smsTemplateCode)
  59. {
  60. $this->smsTemplateCode = $smsTemplateCode;
  61. $this->apiParas["sms_template_code"] = $smsTemplateCode;
  62. }
  63. public function getSmsTemplateCode()
  64. {
  65. return $this->smsTemplateCode;
  66. }
  67. public function setSmsType($smsType)
  68. {
  69. $this->smsType = $smsType;
  70. $this->apiParas["sms_type"] = $smsType;
  71. }
  72. public function getSmsType()
  73. {
  74. return $this->smsType;
  75. }
  76. public function getApiMethodName()
  77. {
  78. return "alibaba.aliqin.fc.iot.sms.send";
  79. }
  80. public function getApiParas()
  81. {
  82. return $this->apiParas;
  83. }
  84. public function check()
  85. {
  86. RequestCheckUtil::checkNotNull($this->recNum,"recNum");
  87. RequestCheckUtil::checkNotNull($this->smsTemplateCode,"smsTemplateCode");
  88. RequestCheckUtil::checkNotNull($this->smsType,"smsType");
  89. }
  90. public function putOtherTextParam($key, $value) {
  91. $this->apiParas[$key] = $value;
  92. $this->$key = $value;
  93. }
  94. }