OapiRobotMessageSendotoRequest.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.robot.message.sendoto request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2022.10.13
  7. */
  8. class OapiRobotMessageSendotoRequest
  9. {
  10. /**
  11. * 申请到的企业机器人唯一标识符
  12. **/
  13. private $chatbotId;
  14. /**
  15. * 申请到的消息模板唯一标识符
  16. **/
  17. private $msgKey;
  18. /**
  19. * 消息模板中,变量本次替换的值
  20. **/
  21. private $msgParam;
  22. /**
  23. * 员工的userid
  24. **/
  25. private $staffId;
  26. private $apiParas = array();
  27. public function setChatbotId($chatbotId)
  28. {
  29. $this->chatbotId = $chatbotId;
  30. $this->apiParas["chatbot_id"] = $chatbotId;
  31. }
  32. public function getChatbotId()
  33. {
  34. return $this->chatbotId;
  35. }
  36. public function setMsgKey($msgKey)
  37. {
  38. $this->msgKey = $msgKey;
  39. $this->apiParas["msg_key"] = $msgKey;
  40. }
  41. public function getMsgKey()
  42. {
  43. return $this->msgKey;
  44. }
  45. public function setMsgParam($msgParam)
  46. {
  47. $this->msgParam = $msgParam;
  48. $this->apiParas["msg_param"] = $msgParam;
  49. }
  50. public function getMsgParam()
  51. {
  52. return $this->msgParam;
  53. }
  54. public function setStaffId($staffId)
  55. {
  56. $this->staffId = $staffId;
  57. $this->apiParas["staff_id"] = $staffId;
  58. }
  59. public function getStaffId()
  60. {
  61. return $this->staffId;
  62. }
  63. public function getApiMethodName()
  64. {
  65. return "dingtalk.oapi.robot.message.sendoto";
  66. }
  67. public function getApiParas()
  68. {
  69. return $this->apiParas;
  70. }
  71. public function check()
  72. {
  73. RequestCheckUtil::checkNotNull($this->chatbotId,"chatbotId");
  74. RequestCheckUtil::checkNotNull($this->msgKey,"msgKey");
  75. RequestCheckUtil::checkNotNull($this->msgParam,"msgParam");
  76. RequestCheckUtil::checkNotNull($this->staffId,"staffId");
  77. }
  78. public function putOtherTextParam($key, $value) {
  79. $this->apiParas[$key] = $value;
  80. $this->$key = $value;
  81. }
  82. }