OapiRobotMessageSendgroupRequest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.robot.message.sendgroup request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2020.03.03
  7. */
  8. class OapiRobotMessageSendgroupRequest
  9. {
  10. /**
  11. * 申请到的消息模板唯一标识符
  12. **/
  13. private $msgKey;
  14. /**
  15. * 消息模板中,变量本次替换的值
  16. **/
  17. private $msgParam;
  18. /**
  19. * 群机器人webhook中的token
  20. **/
  21. private $token;
  22. private $apiParas = array();
  23. public function setMsgKey($msgKey)
  24. {
  25. $this->msgKey = $msgKey;
  26. $this->apiParas["msg_key"] = $msgKey;
  27. }
  28. public function getMsgKey()
  29. {
  30. return $this->msgKey;
  31. }
  32. public function setMsgParam($msgParam)
  33. {
  34. $this->msgParam = $msgParam;
  35. $this->apiParas["msg_param"] = $msgParam;
  36. }
  37. public function getMsgParam()
  38. {
  39. return $this->msgParam;
  40. }
  41. public function setToken($token)
  42. {
  43. $this->token = $token;
  44. $this->apiParas["token"] = $token;
  45. }
  46. public function getToken()
  47. {
  48. return $this->token;
  49. }
  50. public function getApiMethodName()
  51. {
  52. return "dingtalk.oapi.robot.message.sendgroup";
  53. }
  54. public function getApiParas()
  55. {
  56. return $this->apiParas;
  57. }
  58. public function check()
  59. {
  60. RequestCheckUtil::checkNotNull($this->msgKey,"msgKey");
  61. RequestCheckUtil::checkNotNull($this->msgParam,"msgParam");
  62. RequestCheckUtil::checkNotNull($this->token,"token");
  63. }
  64. public function putOtherTextParam($key, $value) {
  65. $this->apiParas[$key] = $value;
  66. $this->$key = $value;
  67. }
  68. }