Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
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
1
Merge Requests
1
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-micro
Commits
3df1499c
Commit
3df1499c
authored
Sep 18, 2020
by
周智鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
markdown 消息发送RPC
parent
9ec6ab8f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
MessageHandler.php
src/Handler/MessageHandler.php
+17
-0
MessageServiceInterface.php
src/Service/Interfaces/MessageServiceInterface.php
+12
-0
No files found.
src/Handler/MessageHandler.php
View file @
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
);
}
}
}
src/Service/Interfaces/MessageServiceInterface.php
View file @
3df1499c
...
@@ -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
;
}
}
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