TbkDgMaterialRecommendRequest.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?php
  2. /**
  3. * TOP API: taobao.tbk.dg.material.recommend request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2025.07.15
  7. */
  8. class TbkDgMaterialRecommendRequest
  9. {
  10. /**
  11. * 推广位id,mm_xxx_xxx_12345678三段式的最后一段数字(登录pub.alimama.com推广管理-推广位管理中查询)
  12. **/
  13. private $adzoneId;
  14. /**
  15. * 智能匹配-设备号加密类型:MD5;使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin
  16. **/
  17. private $deviceEncrypt;
  18. /**
  19. * 智能匹配-设备号类型:IMEI,或者IDFA,或者UTDID(UTDID不支持MD5加密),或者OAID;使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin
  20. **/
  21. private $deviceType;
  22. /**
  23. * 智能匹配-设备号加密后的值(MD5加密需32位小写);使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin
  24. **/
  25. private $deviceValue;
  26. /**
  27. * 选品库收藏夹id,获取收藏夹id参考文档:https://mos.m.taobao.com/union/page_20230109_175050_176?spm=a219t._portal_v2_pages_promo_goods_index_htm.0.0.7c2a75a5H2ER3N
  28. **/
  29. private $favoritesId;
  30. /**
  31. * 淘宝客新商品ID;用于相似商品推荐(注意:使用相似商品推荐material_id=13256必传,并请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin);另关于《淘宝客新商品ID升级》参考白皮书:https://www.yuque.com/taobaolianmengguanfangxiaoer/zmig94/tfyt0pahmlpzu2ud
  32. **/
  33. private $itemId;
  34. /**
  35. * 官方提供的物料Id;可以通过taobao.tbk.optimus.tou.material.ids.get接口获取公开的物料id列表或查看物料id汇总贴:https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10628875?_k=gpov9a
  36. **/
  37. private $materialId;
  38. /**
  39. * 第几页,默认:1
  40. **/
  41. private $pageNo;
  42. /**
  43. * 页大小,默认20,1~100
  44. **/
  45. private $pageSize;
  46. /**
  47. * 1-自购省,2-推广赚(代理模式专属ID,代理模式必填,非代理模式不用填写该字段)
  48. **/
  49. private $promotionType;
  50. /**
  51. * 渠道关系ID,仅适用于渠道推广场景
  52. **/
  53. private $relationId;
  54. /**
  55. * 会员运营ID
  56. **/
  57. private $specialId;
  58. private $apiParas = array();
  59. public function setAdzoneId($adzoneId)
  60. {
  61. $this->adzoneId = $adzoneId;
  62. $this->apiParas["adzone_id"] = $adzoneId;
  63. }
  64. public function getAdzoneId()
  65. {
  66. return $this->adzoneId;
  67. }
  68. public function setDeviceEncrypt($deviceEncrypt)
  69. {
  70. $this->deviceEncrypt = $deviceEncrypt;
  71. $this->apiParas["device_encrypt"] = $deviceEncrypt;
  72. }
  73. public function getDeviceEncrypt()
  74. {
  75. return $this->deviceEncrypt;
  76. }
  77. public function setDeviceType($deviceType)
  78. {
  79. $this->deviceType = $deviceType;
  80. $this->apiParas["device_type"] = $deviceType;
  81. }
  82. public function getDeviceType()
  83. {
  84. return $this->deviceType;
  85. }
  86. public function setDeviceValue($deviceValue)
  87. {
  88. $this->deviceValue = $deviceValue;
  89. $this->apiParas["device_value"] = $deviceValue;
  90. }
  91. public function getDeviceValue()
  92. {
  93. return $this->deviceValue;
  94. }
  95. public function setFavoritesId($favoritesId)
  96. {
  97. $this->favoritesId = $favoritesId;
  98. $this->apiParas["favorites_id"] = $favoritesId;
  99. }
  100. public function getFavoritesId()
  101. {
  102. return $this->favoritesId;
  103. }
  104. public function setItemId($itemId)
  105. {
  106. $this->itemId = $itemId;
  107. $this->apiParas["item_id"] = $itemId;
  108. }
  109. public function getItemId()
  110. {
  111. return $this->itemId;
  112. }
  113. public function setMaterialId($materialId)
  114. {
  115. $this->materialId = $materialId;
  116. $this->apiParas["material_id"] = $materialId;
  117. }
  118. public function getMaterialId()
  119. {
  120. return $this->materialId;
  121. }
  122. public function setPageNo($pageNo)
  123. {
  124. $this->pageNo = $pageNo;
  125. $this->apiParas["page_no"] = $pageNo;
  126. }
  127. public function getPageNo()
  128. {
  129. return $this->pageNo;
  130. }
  131. public function setPageSize($pageSize)
  132. {
  133. $this->pageSize = $pageSize;
  134. $this->apiParas["page_size"] = $pageSize;
  135. }
  136. public function getPageSize()
  137. {
  138. return $this->pageSize;
  139. }
  140. public function setPromotionType($promotionType)
  141. {
  142. $this->promotionType = $promotionType;
  143. $this->apiParas["promotion_type"] = $promotionType;
  144. }
  145. public function getPromotionType()
  146. {
  147. return $this->promotionType;
  148. }
  149. public function setRelationId($relationId)
  150. {
  151. $this->relationId = $relationId;
  152. $this->apiParas["relation_id"] = $relationId;
  153. }
  154. public function getRelationId()
  155. {
  156. return $this->relationId;
  157. }
  158. public function setSpecialId($specialId)
  159. {
  160. $this->specialId = $specialId;
  161. $this->apiParas["special_id"] = $specialId;
  162. }
  163. public function getSpecialId()
  164. {
  165. return $this->specialId;
  166. }
  167. public function getApiMethodName()
  168. {
  169. return "taobao.tbk.dg.material.recommend";
  170. }
  171. public function getApiParas()
  172. {
  173. return $this->apiParas;
  174. }
  175. public function check()
  176. {
  177. RequestCheckUtil::checkNotNull($this->adzoneId,"adzoneId");
  178. RequestCheckUtil::checkNotNull($this->materialId,"materialId");
  179. }
  180. public function putOtherTextParam($key, $value) {
  181. $this->apiParas[$key] = $value;
  182. $this->$key = $value;
  183. }
  184. }