优惠券订单及其他脚本

TbkContentGetRequest.php 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?php
  2. /**
  3. * TOP API: taobao.tbk.content.get request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.04.19
  7. */
  8. class TbkContentGetRequest
  9. {
  10. /**
  11. * 推广位
  12. **/
  13. private $adzoneId;
  14. /**
  15. * 表示取这个时间点以前的数据,以毫秒为单位(出参中的last_timestamp是指本次返回的内容中最早一条的数据,下一次作为before_timestamp传过来,即可实现翻页)
  16. **/
  17. private $beforeTimestamp;
  18. /**
  19. * 类目
  20. **/
  21. private $cid;
  22. /**
  23. * 默认可不传,内容库类型:1 优质内容
  24. **/
  25. private $contentSet;
  26. /**
  27. * 表示期望获取条数
  28. **/
  29. private $count;
  30. /**
  31. * 图片高度
  32. **/
  33. private $imageHeight;
  34. /**
  35. * 图片宽度
  36. **/
  37. private $imageWidth;
  38. /**
  39. * 内容类型,1:图文、2: 图集、3: 短视频
  40. **/
  41. private $type;
  42. private $apiParas = array();
  43. public function setAdzoneId($adzoneId)
  44. {
  45. $this->adzoneId = $adzoneId;
  46. $this->apiParas["adzone_id"] = $adzoneId;
  47. }
  48. public function getAdzoneId()
  49. {
  50. return $this->adzoneId;
  51. }
  52. public function setBeforeTimestamp($beforeTimestamp)
  53. {
  54. $this->beforeTimestamp = $beforeTimestamp;
  55. $this->apiParas["before_timestamp"] = $beforeTimestamp;
  56. }
  57. public function getBeforeTimestamp()
  58. {
  59. return $this->beforeTimestamp;
  60. }
  61. public function setCid($cid)
  62. {
  63. $this->cid = $cid;
  64. $this->apiParas["cid"] = $cid;
  65. }
  66. public function getCid()
  67. {
  68. return $this->cid;
  69. }
  70. public function setContentSet($contentSet)
  71. {
  72. $this->contentSet = $contentSet;
  73. $this->apiParas["content_set"] = $contentSet;
  74. }
  75. public function getContentSet()
  76. {
  77. return $this->contentSet;
  78. }
  79. public function setCount($count)
  80. {
  81. $this->count = $count;
  82. $this->apiParas["count"] = $count;
  83. }
  84. public function getCount()
  85. {
  86. return $this->count;
  87. }
  88. public function setImageHeight($imageHeight)
  89. {
  90. $this->imageHeight = $imageHeight;
  91. $this->apiParas["image_height"] = $imageHeight;
  92. }
  93. public function getImageHeight()
  94. {
  95. return $this->imageHeight;
  96. }
  97. public function setImageWidth($imageWidth)
  98. {
  99. $this->imageWidth = $imageWidth;
  100. $this->apiParas["image_width"] = $imageWidth;
  101. }
  102. public function getImageWidth()
  103. {
  104. return $this->imageWidth;
  105. }
  106. public function setType($type)
  107. {
  108. $this->type = $type;
  109. $this->apiParas["type"] = $type;
  110. }
  111. public function getType()
  112. {
  113. return $this->type;
  114. }
  115. public function getApiMethodName()
  116. {
  117. return "taobao.tbk.content.get";
  118. }
  119. public function getApiParas()
  120. {
  121. return $this->apiParas;
  122. }
  123. public function check()
  124. {
  125. RequestCheckUtil::checkNotNull($this->adzoneId,"adzoneId");
  126. RequestCheckUtil::checkMaxValue($this->imageHeight,1000,"imageHeight");
  127. RequestCheckUtil::checkMinValue($this->imageHeight,10,"imageHeight");
  128. RequestCheckUtil::checkMaxValue($this->imageWidth,1000,"imageWidth");
  129. RequestCheckUtil::checkMinValue($this->imageWidth,10,"imageWidth");
  130. }
  131. public function putOtherTextParam($key, $value) {
  132. $this->apiParas[$key] = $value;
  133. $this->$key = $value;
  134. }
  135. }