优惠券订单及其他脚本

TbkScOptimusMaterialRequest.php 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <?php
  2. /**
  3. * TOP API: taobao.tbk.sc.optimus.material request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.04.19
  7. */
  8. class TbkScOptimusMaterialRequest
  9. {
  10. /**
  11. * mm_xxx_xxx_xxx的第三位
  12. **/
  13. private $adzoneId;
  14. /**
  15. * 内容专用-内容详情ID
  16. **/
  17. private $contentId;
  18. /**
  19. * 内容专用-内容渠道信息
  20. **/
  21. private $contentSource;
  22. /**
  23. * 智能匹配-设备号加密类型:MD5
  24. **/
  25. private $deviceEncrypt;
  26. /**
  27. * 智能匹配-设备号类型:IMEI,或者IDFA,或者UTDID(UTDID不支持MD5加密)
  28. **/
  29. private $deviceType;
  30. /**
  31. * 智能匹配-设备号加密后的值(MD5加密需32位小写)
  32. **/
  33. private $deviceValue;
  34. /**
  35. * 商品ID,用于相似商品推荐
  36. **/
  37. private $itemId;
  38. /**
  39. * 官方的物料Id(详细物料id见:https://tbk.bbs.taobao.com/detail.html?appId=45301&postId=8576096)
  40. **/
  41. private $materialId;
  42. /**
  43. * 第几页,默认:1
  44. **/
  45. private $pageNo;
  46. /**
  47. * 页大小,默认20,1~100
  48. **/
  49. private $pageSize;
  50. /**
  51. * mm_xxx_xxx_xxx的第二位
  52. **/
  53. private $siteId;
  54. private $apiParas = array();
  55. public function setAdzoneId($adzoneId)
  56. {
  57. $this->adzoneId = $adzoneId;
  58. $this->apiParas["adzone_id"] = $adzoneId;
  59. }
  60. public function getAdzoneId()
  61. {
  62. return $this->adzoneId;
  63. }
  64. public function setContentId($contentId)
  65. {
  66. $this->contentId = $contentId;
  67. $this->apiParas["content_id"] = $contentId;
  68. }
  69. public function getContentId()
  70. {
  71. return $this->contentId;
  72. }
  73. public function setContentSource($contentSource)
  74. {
  75. $this->contentSource = $contentSource;
  76. $this->apiParas["content_source"] = $contentSource;
  77. }
  78. public function getContentSource()
  79. {
  80. return $this->contentSource;
  81. }
  82. public function setDeviceEncrypt($deviceEncrypt)
  83. {
  84. $this->deviceEncrypt = $deviceEncrypt;
  85. $this->apiParas["device_encrypt"] = $deviceEncrypt;
  86. }
  87. public function getDeviceEncrypt()
  88. {
  89. return $this->deviceEncrypt;
  90. }
  91. public function setDeviceType($deviceType)
  92. {
  93. $this->deviceType = $deviceType;
  94. $this->apiParas["device_type"] = $deviceType;
  95. }
  96. public function getDeviceType()
  97. {
  98. return $this->deviceType;
  99. }
  100. public function setDeviceValue($deviceValue)
  101. {
  102. $this->deviceValue = $deviceValue;
  103. $this->apiParas["device_value"] = $deviceValue;
  104. }
  105. public function getDeviceValue()
  106. {
  107. return $this->deviceValue;
  108. }
  109. public function setItemId($itemId)
  110. {
  111. $this->itemId = $itemId;
  112. $this->apiParas["item_id"] = $itemId;
  113. }
  114. public function getItemId()
  115. {
  116. return $this->itemId;
  117. }
  118. public function setMaterialId($materialId)
  119. {
  120. $this->materialId = $materialId;
  121. $this->apiParas["material_id"] = $materialId;
  122. }
  123. public function getMaterialId()
  124. {
  125. return $this->materialId;
  126. }
  127. public function setPageNo($pageNo)
  128. {
  129. $this->pageNo = $pageNo;
  130. $this->apiParas["page_no"] = $pageNo;
  131. }
  132. public function getPageNo()
  133. {
  134. return $this->pageNo;
  135. }
  136. public function setPageSize($pageSize)
  137. {
  138. $this->pageSize = $pageSize;
  139. $this->apiParas["page_size"] = $pageSize;
  140. }
  141. public function getPageSize()
  142. {
  143. return $this->pageSize;
  144. }
  145. public function setSiteId($siteId)
  146. {
  147. $this->siteId = $siteId;
  148. $this->apiParas["site_id"] = $siteId;
  149. }
  150. public function getSiteId()
  151. {
  152. return $this->siteId;
  153. }
  154. public function getApiMethodName()
  155. {
  156. return "taobao.tbk.sc.optimus.material";
  157. }
  158. public function getApiParas()
  159. {
  160. return $this->apiParas;
  161. }
  162. public function check()
  163. {
  164. RequestCheckUtil::checkNotNull($this->adzoneId,"adzoneId");
  165. RequestCheckUtil::checkMaxValue($this->pageSize,100,"pageSize");
  166. RequestCheckUtil::checkMinValue($this->pageSize,1,"pageSize");
  167. RequestCheckUtil::checkNotNull($this->siteId,"siteId");
  168. }
  169. public function putOtherTextParam($key, $value) {
  170. $this->apiParas[$key] = $value;
  171. $this->$key = $value;
  172. }
  173. }