增加后台消息通知管理
This commit is contained in:
@@ -146,9 +146,9 @@ class WsEvents
|
||||
|
||||
if (!$title || !$content) {
|
||||
Gateway::sendToClient($this->clientId, WsResponse::error(
|
||||
'notify.push',
|
||||
'notify.push.result',
|
||||
400,
|
||||
'title and content are required',
|
||||
'标题和内容不能为空',
|
||||
$traceId
|
||||
));
|
||||
return;
|
||||
@@ -163,13 +163,14 @@ class WsEvents
|
||||
'content' => $content,
|
||||
'scene' => $this->eventData['scene'] ?? 0,
|
||||
'recipient' => $this->eventData['to_uids'] ? implode(',', $this->eventData['to_uids']) : '',
|
||||
'push_method' => isset($this->eventData['push_method']) ? $this->eventData['push_method'] : 0
|
||||
]);
|
||||
|
||||
// 写用户状态
|
||||
$uids = !empty($toUids) ? $toUids : $msgService->getAllUserIds();
|
||||
$msgService->addUserStatus($msgId, $uids);
|
||||
|
||||
$payload = WsResponse::success('notify.push', [
|
||||
$payload = WsResponse::success('notify.receive', [
|
||||
'msg_id' => $msgId,
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
@@ -203,9 +204,9 @@ class WsEvents
|
||||
$msgIds = $this->eventData['msg_ids'];
|
||||
if (!is_array($msgIds) && $msgIds !== 'all') {
|
||||
Gateway::sendToClient($this->clientId, WsResponse::error(
|
||||
'notify.read',
|
||||
'notify.read.result',
|
||||
400,
|
||||
'msg_ids required',
|
||||
'消息ID不能为空',
|
||||
$traceId
|
||||
));
|
||||
return;
|
||||
@@ -227,7 +228,7 @@ class WsEvents
|
||||
*/
|
||||
public function pushNotice(int $msgId, string $title, string $content, array $recipient)
|
||||
{
|
||||
$payload = WsResponse::success('notify.push', [
|
||||
$payload = WsResponse::success('notify.receive', [
|
||||
'msg_id' => $msgId,
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
|
||||
Reference in New Issue
Block a user