Commit 3df1499c authored by 周智鹏's avatar 周智鹏
Browse files

markdown 消息发送RPC

parent 9ec6ab8f
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -113,4 +113,21 @@ class MessageHandler
        $this->messageService->send($receiverIds, $application, 0, 0, [], $content);
        $this->messageService->send($receiverIds, $application, 0, 0, [], $content);
    }
    }


    /**
     * 发送markdown 文本消息
     * @param $receiverIds
     * @param $content
     * @param $title
     * @throws HttpResponseException
     */
    public function sendMarkDownText($receiverIds, $content,$title)
    {
        $application = $this->config->get('app_name');
        if (!$application) {
            throw new HttpResponseException("请设置应用名app_name");
        }
        $receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds];
        $this->messageService->SendMarkDownMessage($receiverIds, $application, 0, 0, [], $content,$title);
    }

}
}
+12 −0
Original line number Original line Diff line number Diff line
@@ -37,4 +37,16 @@ interface MessageServiceInterface
    public function sendMail($userList, $subject, $body): bool;
    public function sendMail($userList, $subject, $body): bool;




    /**
     * 发送markdown文本消息
     * @param array $receiveUserId
     * @param $application
     * @param int $templateId
     * @param int $sendUserId
     * @param array $replace
     * @param string $content
     * @param string $title
     * @return bool
     */
    public function SendMarkDownMessage(array $receiveUserId, $application, $templateId = 0, $sendUserId = 0, $replace = [], $content = '',$title = ''): bool;
}
}