26 lines
455 B
PHP
26 lines
455 B
PHP
<?php
|
|
|
|
namespace Wechat\Work;
|
|
|
|
use Wechat\Work\MessageInterface;
|
|
|
|
class Message
|
|
{
|
|
|
|
/**
|
|
* @var Work
|
|
*/
|
|
protected $work;
|
|
|
|
public function __construct($work)
|
|
{
|
|
$this->work = $work;
|
|
}
|
|
|
|
public function send($msg)
|
|
{
|
|
$request = $this->work->transformForJsonRequest('message/send',
|
|
$msg->toArray() + ['agentid' => $this->work->getAgentId()]);
|
|
return $this->work->request($request);
|
|
}
|
|
} |