Commit 78564e78 authored by 王源's avatar 王源 🎧

Merge remote-tracking branch 'origin/user-rpc' into test

parents 11a5333f 7e813db9
......@@ -53,15 +53,31 @@ class MessageHandler
* @param $content
* @throws HttpResponseException
*/
public function sendText($receiverIds, $content)
public function sendText($receiverIds, $content, $sendUserId = null)
{
$application = $this->config->get('app_name');
if (!$application) {
throw new HttpResponseException("请设置应用名app_name");
}
$receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds];
$sendUserId = Auth::id();
$sendUserId =$sendUserId ?: Auth::id();
$this->messageService->send($receiverIds, $application, 0, $sendUserId, [], $content);
}
/**
* 定时任务专用 发送文本消息
* @param $receiverIds
* @param $content
* @throws HttpResponseException
*/
public function sendCrontabText($receiverIds, $content)
{
$application = $this->config->get('app_name');
if (!$application) {
throw new HttpResponseException("请设置应用名app_name");
}
$receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds];
$this->messageService->send($receiverIds, $application, 0, 0, [], $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