hyperf-chat/app/Constant/TalkEventConstant.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2020-12-01 17:47:25 +08:00
<?php
2021-09-11 12:41:28 +08:00
declare(strict_types=1);
2020-12-01 17:47:25 +08:00
2022-01-22 20:08:19 +08:00
namespace App\Constant;
2020-12-01 17:47:25 +08:00
/**
2020-12-02 15:14:29 +08:00
* WebSocket 消息事件枚举
2020-12-01 17:47:25 +08:00
*
2020-12-02 15:14:29 +08:00
* @package App\Constants
2020-12-01 17:47:25 +08:00
*/
2021-07-20 23:12:18 +08:00
class TalkEventConstant
2020-12-01 17:47:25 +08:00
{
/**
2020-12-02 15:14:29 +08:00
* 对话消息通知 - 事件名
2020-12-01 17:47:25 +08:00
*/
const EVENT_TALK = 'event_talk';
/**
2020-12-02 15:14:29 +08:00
* 键盘输入事件通知 - 事件名
2020-12-01 17:47:25 +08:00
*/
2022-04-12 19:34:20 +08:00
const EVENT_TALK_KEYBOARD = 'event_talk_keyboard';
2020-12-01 17:47:25 +08:00
/**
2020-12-02 15:14:29 +08:00
* 用户在线状态通知 - 事件名
2020-12-01 17:47:25 +08:00
*/
2022-04-12 19:34:20 +08:00
const EVENT_LOGIN = 'event_login';
2020-12-01 17:47:25 +08:00
/**
2020-12-02 15:14:29 +08:00
* 聊天消息撤销通知 - 事件名
2020-12-01 17:47:25 +08:00
*/
2022-04-12 19:34:20 +08:00
const EVENT_TALK_REVOKE = 'event_talk_revoke';
2020-12-01 17:47:25 +08:00
/**
2020-12-02 15:14:29 +08:00
* 好友申请消息通知 - 事件名
2020-12-01 17:47:25 +08:00
*/
2022-04-12 19:34:20 +08:00
const EVENT_CONTACT_APPLY = 'event_contact_apply';
2020-12-01 17:47:25 +08:00
2020-12-03 16:22:55 +08:00
/**
* @return array
*/
public static function getMap(): array
{
return [
2021-04-20 16:30:57 +08:00
self::EVENT_TALK => '对话消息通知',
2022-04-12 19:34:20 +08:00
self::EVENT_TALK_KEYBOARD => '键盘输入事件通知',
self::EVENT_LOGIN => '用户在线状态通知',
self::EVENT_TALK_REVOKE => '聊天消息撤销通知',
self::EVENT_CONTACT_APPLY => '好友申请消息通知'
2020-12-03 16:22:55 +08:00
];
}
2020-12-01 17:47:25 +08:00
}