OapiMessageSendToConversationRequest.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.message.send_to_conversation request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.12.16
  7. */
  8. class OapiMessageSendToConversationRequest
  9. {
  10. /**
  11. * ActionCard消息
  12. **/
  13. private $actionCard;
  14. /**
  15. * 群消息或者个人聊天会话Id,(通过JSAPI之pickConversation接口唤起联系人界面选择之后即可拿到会话ID,之后您可以使用获取到的cid调用此接口)
  16. **/
  17. private $cid;
  18. /**
  19. * file消息
  20. **/
  21. private $file;
  22. /**
  23. * image消息
  24. **/
  25. private $image;
  26. /**
  27. * link消息
  28. **/
  29. private $link;
  30. /**
  31. * markdown消息
  32. **/
  33. private $markdown;
  34. /**
  35. * 消息内容
  36. **/
  37. private $msg;
  38. /**
  39. * 消息类型
  40. **/
  41. private $msgtype;
  42. /**
  43. * OA消息
  44. **/
  45. private $oa;
  46. /**
  47. * 消息发送者员工ID
  48. **/
  49. private $sender;
  50. /**
  51. * text消息
  52. **/
  53. private $text;
  54. /**
  55. * voice消息
  56. **/
  57. private $voice;
  58. private $apiParas = array();
  59. public function setActionCard($actionCard)
  60. {
  61. $this->actionCard = $actionCard;
  62. $this->apiParas["action_card"] = $actionCard;
  63. }
  64. public function getActionCard()
  65. {
  66. return $this->actionCard;
  67. }
  68. public function setCid($cid)
  69. {
  70. $this->cid = $cid;
  71. $this->apiParas["cid"] = $cid;
  72. }
  73. public function getCid()
  74. {
  75. return $this->cid;
  76. }
  77. public function setFile($file)
  78. {
  79. $this->file = $file;
  80. $this->apiParas["file"] = $file;
  81. }
  82. public function getFile()
  83. {
  84. return $this->file;
  85. }
  86. public function setImage($image)
  87. {
  88. $this->image = $image;
  89. $this->apiParas["image"] = $image;
  90. }
  91. public function getImage()
  92. {
  93. return $this->image;
  94. }
  95. public function setLink($link)
  96. {
  97. $this->link = $link;
  98. $this->apiParas["link"] = $link;
  99. }
  100. public function getLink()
  101. {
  102. return $this->link;
  103. }
  104. public function setMarkdown($markdown)
  105. {
  106. $this->markdown = $markdown;
  107. $this->apiParas["markdown"] = $markdown;
  108. }
  109. public function getMarkdown()
  110. {
  111. return $this->markdown;
  112. }
  113. public function setMsg($msg)
  114. {
  115. $this->msg = $msg;
  116. $this->apiParas["msg"] = $msg;
  117. }
  118. public function getMsg()
  119. {
  120. return $this->msg;
  121. }
  122. public function setMsgtype($msgtype)
  123. {
  124. $this->msgtype = $msgtype;
  125. $this->apiParas["msgtype"] = $msgtype;
  126. }
  127. public function getMsgtype()
  128. {
  129. return $this->msgtype;
  130. }
  131. public function setOa($oa)
  132. {
  133. $this->oa = $oa;
  134. $this->apiParas["oa"] = $oa;
  135. }
  136. public function getOa()
  137. {
  138. return $this->oa;
  139. }
  140. public function setSender($sender)
  141. {
  142. $this->sender = $sender;
  143. $this->apiParas["sender"] = $sender;
  144. }
  145. public function getSender()
  146. {
  147. return $this->sender;
  148. }
  149. public function setText($text)
  150. {
  151. $this->text = $text;
  152. $this->apiParas["text"] = $text;
  153. }
  154. public function getText()
  155. {
  156. return $this->text;
  157. }
  158. public function setVoice($voice)
  159. {
  160. $this->voice = $voice;
  161. $this->apiParas["voice"] = $voice;
  162. }
  163. public function getVoice()
  164. {
  165. return $this->voice;
  166. }
  167. public function getApiMethodName()
  168. {
  169. return "dingtalk.oapi.message.send_to_conversation";
  170. }
  171. public function getApiParas()
  172. {
  173. return $this->apiParas;
  174. }
  175. public function check()
  176. {
  177. }
  178. public function putOtherTextParam($key, $value) {
  179. $this->apiParas[$key] = $value;
  180. $this->$key = $value;
  181. }
  182. }