From aec96fb36d6d1881586425e37b1f3b964cc41857 Mon Sep 17 00:00:00 2001 From: lisida <506400117@qq.com> Date: Wed, 10 Jul 2019 17:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E6=95=88=E5=9B=BE=E7=89=87=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Wechat/Work/Message/MessageInterface.php | 7 +++++++ src/Wechat/Work/Message/TextImageMessage.php | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/Wechat/Work/Message/TextImageMessage.php diff --git a/src/Wechat/Work/Message/MessageInterface.php b/src/Wechat/Work/Message/MessageInterface.php index b61fc35..b0366b3 100644 --- a/src/Wechat/Work/Message/MessageInterface.php +++ b/src/Wechat/Work/Message/MessageInterface.php @@ -67,6 +67,13 @@ abstract class MessageInterface $this->type => $this->attr, ]); break; + case self::TYPE_IMAGE: + $params = array_merge($params, [ + $this->type => [ + 'media_id' => $this->attr['media_id'], + ], + ]); + break; default: throw new \Exception('message type ' . $this->type . ' is not allow'); } diff --git a/src/Wechat/Work/Message/TextImageMessage.php b/src/Wechat/Work/Message/TextImageMessage.php new file mode 100644 index 0000000..f4b2236 --- /dev/null +++ b/src/Wechat/Work/Message/TextImageMessage.php @@ -0,0 +1,16 @@ +type = self::TYPE_IMAGE; + $this->attr['media_id'] = $content; + } + +} \ No newline at end of file