OapiEduRecommendCreateRequest.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.edu.recommend.create request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2021.04.21
  7. */
  8. class OapiEduRecommendCreateRequest
  9. {
  10. /**
  11. * 班级ID
  12. **/
  13. private $classId;
  14. /**
  15. * 内容标签,推荐扩散给其他用户使用
  16. **/
  17. private $labelList;
  18. /**
  19. * ISV侧内容唯一ID
  20. **/
  21. private $outContentId;
  22. /**
  23. * 学段
  24. **/
  25. private $periodCode;
  26. /**
  27. * 回跳地址
  28. **/
  29. private $returnUrl;
  30. /**
  31. * 学科
  32. **/
  33. private $subjectCode;
  34. /**
  35. * 摘要
  36. **/
  37. private $summary;
  38. /**
  39. * 教材版本
  40. **/
  41. private $textbookCode;
  42. /**
  43. * 缩略图url地址
  44. **/
  45. private $thumbnail;
  46. /**
  47. * 内容标题
  48. **/
  49. private $title;
  50. /**
  51. * 内容总时长,单位秒
  52. **/
  53. private $totalTime;
  54. /**
  55. * 类型:1词汇 2课文 3题目 4考试 5知识点 6课程 7其他
  56. **/
  57. private $type;
  58. /**
  59. * 当前用户userid
  60. **/
  61. private $userid;
  62. private $apiParas = array();
  63. public function setClassId($classId)
  64. {
  65. $this->classId = $classId;
  66. $this->apiParas["class_id"] = $classId;
  67. }
  68. public function getClassId()
  69. {
  70. return $this->classId;
  71. }
  72. public function setLabelList($labelList)
  73. {
  74. $this->labelList = $labelList;
  75. $this->apiParas["labelList"] = $labelList;
  76. }
  77. public function getLabelList()
  78. {
  79. return $this->labelList;
  80. }
  81. public function setOutContentId($outContentId)
  82. {
  83. $this->outContentId = $outContentId;
  84. $this->apiParas["out_content_id"] = $outContentId;
  85. }
  86. public function getOutContentId()
  87. {
  88. return $this->outContentId;
  89. }
  90. public function setPeriodCode($periodCode)
  91. {
  92. $this->periodCode = $periodCode;
  93. $this->apiParas["period_code"] = $periodCode;
  94. }
  95. public function getPeriodCode()
  96. {
  97. return $this->periodCode;
  98. }
  99. public function setReturnUrl($returnUrl)
  100. {
  101. $this->returnUrl = $returnUrl;
  102. $this->apiParas["return_url"] = $returnUrl;
  103. }
  104. public function getReturnUrl()
  105. {
  106. return $this->returnUrl;
  107. }
  108. public function setSubjectCode($subjectCode)
  109. {
  110. $this->subjectCode = $subjectCode;
  111. $this->apiParas["subject_code"] = $subjectCode;
  112. }
  113. public function getSubjectCode()
  114. {
  115. return $this->subjectCode;
  116. }
  117. public function setSummary($summary)
  118. {
  119. $this->summary = $summary;
  120. $this->apiParas["summary"] = $summary;
  121. }
  122. public function getSummary()
  123. {
  124. return $this->summary;
  125. }
  126. public function setTextbookCode($textbookCode)
  127. {
  128. $this->textbookCode = $textbookCode;
  129. $this->apiParas["textbook_code"] = $textbookCode;
  130. }
  131. public function getTextbookCode()
  132. {
  133. return $this->textbookCode;
  134. }
  135. public function setThumbnail($thumbnail)
  136. {
  137. $this->thumbnail = $thumbnail;
  138. $this->apiParas["thumbnail"] = $thumbnail;
  139. }
  140. public function getThumbnail()
  141. {
  142. return $this->thumbnail;
  143. }
  144. public function setTitle($title)
  145. {
  146. $this->title = $title;
  147. $this->apiParas["title"] = $title;
  148. }
  149. public function getTitle()
  150. {
  151. return $this->title;
  152. }
  153. public function setTotalTime($totalTime)
  154. {
  155. $this->totalTime = $totalTime;
  156. $this->apiParas["totalTime"] = $totalTime;
  157. }
  158. public function getTotalTime()
  159. {
  160. return $this->totalTime;
  161. }
  162. public function setType($type)
  163. {
  164. $this->type = $type;
  165. $this->apiParas["type"] = $type;
  166. }
  167. public function getType()
  168. {
  169. return $this->type;
  170. }
  171. public function setUserid($userid)
  172. {
  173. $this->userid = $userid;
  174. $this->apiParas["userid"] = $userid;
  175. }
  176. public function getUserid()
  177. {
  178. return $this->userid;
  179. }
  180. public function getApiMethodName()
  181. {
  182. return "dingtalk.oapi.edu.recommend.create";
  183. }
  184. public function getApiParas()
  185. {
  186. return $this->apiParas;
  187. }
  188. public function check()
  189. {
  190. RequestCheckUtil::checkMaxListSize($this->labelList,100,"labelList");
  191. RequestCheckUtil::checkNotNull($this->outContentId,"outContentId");
  192. RequestCheckUtil::checkNotNull($this->periodCode,"periodCode");
  193. RequestCheckUtil::checkNotNull($this->returnUrl,"returnUrl");
  194. RequestCheckUtil::checkNotNull($this->thumbnail,"thumbnail");
  195. RequestCheckUtil::checkNotNull($this->title,"title");
  196. RequestCheckUtil::checkNotNull($this->type,"type");
  197. RequestCheckUtil::checkNotNull($this->userid,"userid");
  198. }
  199. public function putOtherTextParam($key, $value) {
  200. $this->apiParas[$key] = $value;
  201. $this->$key = $value;
  202. }
  203. }