硕顺crm后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
1.2 KiB

<?php
namespace WeWork\Message;
class Video implements ResponseMessageInterface, ReplyMessageInterface
{
/**
* @var string
*/
private $mediaId;
/**
* @var string
*/
private $title;
/**
* @var string
*/
private $description;
/**
* @param string $mediaId
* @param string $title
* @param string $description
*/
public function __construct(string $mediaId, string $title = '', string $description = '')
{
$this->mediaId = $mediaId;
$this->title = $title;
$this->description = $description;
}
/**
* @return array
*/
public function formatForReply(): array
{
return [
'MsgType' => 'video',
'Video' => [
'MediaId' => $this->mediaId,
'Title' => $this->title,
'Description' => $this->description
]
];
}
/**
* @return array
*/
public function formatForResponse(): array
{
return [
'msgtype' => 'video',
'video' => [
'media_id' => $this->mediaId,
'title' => $this->title,
'description' => $this->description
]
];
}
}