增效图片消息

This commit is contained in:
lisida 2019-07-10 17:41:42 +08:00
parent db20f3453c
commit aec96fb36d
2 changed files with 23 additions and 0 deletions

View File

@ -67,6 +67,13 @@ abstract class MessageInterface
$this->type => $this->attr, $this->type => $this->attr,
]); ]);
break; break;
case self::TYPE_IMAGE:
$params = array_merge($params, [
$this->type => [
'media_id' => $this->attr['media_id'],
],
]);
break;
default: default:
throw new \Exception('message type ' . $this->type . ' is not allow'); throw new \Exception('message type ' . $this->type . ' is not allow');
} }

View File

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