Commit 73c9f347 authored by 王源's avatar 王源 🎧

Merge branch 'msg-rpc' into test

parents 9f9dd18e 3df1499c
...@@ -113,4 +113,21 @@ class MessageHandler ...@@ -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);
}
} }
...@@ -18,4 +18,23 @@ interface AppServiceInterface ...@@ -18,4 +18,23 @@ interface AppServiceInterface
* @return mixed * @return mixed
*/ */
public function getAccessApps($user, $isSuperAdmin = false); public function getAccessApps($user, $isSuperAdmin = false);
/**
* 获取单个数据
* @param int $id
* @param array $relations 关联关系只有['group']
* @param array $columns
* @return mixed
*/
public function get(int $id, array $relations = [], array $columns = ['id', 'title']);
/**
* 通过id列表获取应用数组
* @param array $idList 默认去重
* @param array $relations 关联关系只有['group']
* @param array $columns 默认展示id和title,可传['title', 'name', 'entry', 'prefix', 'group_id', 'is_inside', 'is_active', 'icon', 'desc', 'weight']
* @return array 默认keyBy('id')
*/
public function getByIdList(array $idList, array $relations = [], array $columns = ['id', 'title']): array;
} }
...@@ -37,4 +37,16 @@ interface MessageServiceInterface ...@@ -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;
} }
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