Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-rpc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-rpc
Commits
73c9f347
Commit
73c9f347
authored
Sep 18, 2020
by
王源
🎧
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'msg-rpc' into test
parents
9f9dd18e
3df1499c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
MessageHandler.php
src/Handler/MessageHandler.php
+17
-0
AppServiceInterface.php
src/Service/Interfaces/AppServiceInterface.php
+19
-0
MessageServiceInterface.php
src/Service/Interfaces/MessageServiceInterface.php
+12
-0
No files found.
src/Handler/MessageHandler.php
View file @
73c9f347
...
...
@@ -113,4 +113,21 @@ class MessageHandler
$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
);
}
}
src/Service/Interfaces/AppServiceInterface.php
View file @
73c9f347
...
...
@@ -18,4 +18,23 @@ interface AppServiceInterface
* @return mixed
*/
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
;
}
src/Service/Interfaces/MessageServiceInterface.php
View file @
73c9f347
...
...
@@ -37,4 +37,16 @@ interface MessageServiceInterface
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment