12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- /**
- * dingtalk API: dingtalk.oapi.smartbot.msg.push request
- *
- * @author auto create
- * @since 1.0, 2021.03.19
- */
- class OapiSmartbotMsgPushRequest
- {
- /**
- * 接收者的会话chatid列表
- **/
- private $chatIdList;
-
- /**
- * 消息体,具体见文档
- **/
- private $msg;
-
- /**
- * 是否发送给企业全部用户,”true“则忽略用户列表和会话列表
- **/
- private $toAllUser;
-
- /**
- * 接收者的用户userid列表
- **/
- private $userIdList;
-
- private $apiParas = array();
-
- public function setChatIdList($chatIdList)
- {
- $this->chatIdList = $chatIdList;
- $this->apiParas["chat_id_list"] = $chatIdList;
- }
- public function getChatIdList()
- {
- return $this->chatIdList;
- }
- public function setMsg($msg)
- {
- $this->msg = $msg;
- $this->apiParas["msg"] = $msg;
- }
- public function getMsg()
- {
- return $this->msg;
- }
- public function setToAllUser($toAllUser)
- {
- $this->toAllUser = $toAllUser;
- $this->apiParas["to_all_user"] = $toAllUser;
- }
- public function getToAllUser()
- {
- return $this->toAllUser;
- }
- public function setUserIdList($userIdList)
- {
- $this->userIdList = $userIdList;
- $this->apiParas["user_id_list"] = $userIdList;
- }
- public function getUserIdList()
- {
- return $this->userIdList;
- }
- public function getApiMethodName()
- {
- return "dingtalk.oapi.smartbot.msg.push";
- }
-
- public function getApiParas()
- {
- return $this->apiParas;
- }
-
- public function check()
- {
-
- RequestCheckUtil::checkMaxListSize($this->chatIdList,500,"chatIdList");
- RequestCheckUtil::checkMaxListSize($this->userIdList,5000,"userIdList");
- }
-
- public function putOtherTextParam($key, $value) {
- $this->apiParas[$key] = $value;
- $this->$key = $value;
- }
- }
|