OapiImGroupappSysmsgSendRequest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.im.groupapp.sysmsg.send request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2020.06.30
  7. */
  8. class OapiImGroupappSysmsgSendRequest
  9. {
  10. /**
  11. * 申请到的消息模板唯一标识符
  12. **/
  13. private $msgKey;
  14. /**
  15. * 消息模板中,变量本次替换的值
  16. **/
  17. private $msgParam;
  18. /**
  19. * 开放的群ID
  20. **/
  21. private $openConversationId;
  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 setOpenConversationId($openConversationId)
  42. {
  43. $this->openConversationId = $openConversationId;
  44. $this->apiParas["open_conversation_id"] = $openConversationId;
  45. }
  46. public function getOpenConversationId()
  47. {
  48. return $this->openConversationId;
  49. }
  50. public function getApiMethodName()
  51. {
  52. return "dingtalk.oapi.im.groupapp.sysmsg.send";
  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->openConversationId,"openConversationId");
  63. }
  64. public function putOtherTextParam($key, $value) {
  65. $this->apiParas[$key] = $value;
  66. $this->$key = $value;
  67. }
  68. }