Merge branch 'feature/notify_file' into 'master'

支持文件

See merge request composer/php-wechat-sdk!2
This commit is contained in:
董巍 2019-07-15 10:41:14 +08:00
commit 1cf9ddb6df
2 changed files with 17 additions and 0 deletions

View File

@ -67,6 +67,7 @@ abstract class MessageInterface
$this->type => $this->attr,
]);
break;
case self::TYPE_FILE:
case self::TYPE_IMAGE:
$params = array_merge($params, [
$this->type => [

View File

@ -0,0 +1,16 @@
<?php
namespace Wechat\Work\Message;
use Wechat\Work\Message\MessageInterface;
class TextFileMessage extends MessageInterface
{
public function __construct($content)
{
$this->type = self::TYPE_FILE;
$this->attr['media_id'] = $content;
}
}