<?phpnamespace wework\struct;use wework\Utils;use wework\exception\QyApiError;use wework\struct\message\MessageContent;class Message{/** @var bool, 是否全员发送, 即文档所谓 @all */public $sendToAll = false;/** @var string[]|array */public $touser = array();/** @var int[]|array */public $toparty = array();/** @var int[]|array */public $totag = array();/** @var int */public $agentid = null;/** @var int, 表示是否是保密消息,0表示否,1表示是,默认0 */public $safe = null;/*** @var MessageContent xxxMessageContent*/public $messageContent = null;public function CheckMessageSendArgs(){if (count($this->touser) > 1000) {throw new QyApiError("touser should be no more than 1000");}if (count($this->toparty) > 100) {throw new QyApiError("toparty should be no more than 100");}if (count($this->totag) > 100) {throw new QyApiError("toparty should be no more than 100");}if (is_null($this->messageContent)) {throw new QyApiError("messageContent is empty");}$this->messageContent->CheckMessageSendArgs();}public function Message2Array(){$args = array();if (true == $this->sendToAll) {Utils::setIfNotNull("@all", "touser", $args);} else {//$touser_string = null;foreach ($this->touser as $item) {$touser_string = $touser_string.$item."|";}Utils::setIfNotNull($touser_string, "touser", $args);//$toparty_string = null;foreach ($this->toparty as $item) {$toparty_string = $toparty_string.$item."|";}Utils::setIfNotNull($toparty_string, "toparty", $args);//$totag_string = null;foreach ($this->totag as $item) {$totag_string = $totag_string.$item."|";}Utils::setIfNotNull($totag_string, "totag", $args);}Utils::setIfNotNull($this->agentid, "agentid", $args);Utils::setIfNotNull($this->safe, "safe", $args);$this->messageContent->MessageContent2Array($args);return $args;}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。