Commit 6435bf5f authored by 王源's avatar 王源 🎧

MessageHandler添加发送文本消息方法

parent a2f85ee0
...@@ -47,4 +47,21 @@ class MessageHandler ...@@ -47,4 +47,21 @@ class MessageHandler
$this->messageService->send($receiverIds, $application, $templateId, $sendUserId, $replace); $this->messageService->send($receiverIds, $application, $templateId, $sendUserId, $replace);
} }
} /**
\ No newline at end of file * 发送文本消息
* @param $receiverIds
* @param $content
* @throws HttpResponseException
*/
public function sendText($receiverIds, $content)
{
$application = $this->config->get('app_name');
if (!$application) {
throw new HttpResponseException("请设置应用名app_name");
}
$receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds];
$sendUserId = Auth::id();
$this->messageService->send($receiverIds, $application, 0, $sendUserId, [], $content);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment