优化代码

main
raoyuandong 2021-04-17 16:33:09 +08:00
parent dfac0fdcd7
commit 918c1c19c9
2 changed files with 11 additions and 11 deletions

View File

@ -370,19 +370,19 @@ class ChatMessageConsumer extends ConsumerMessage
private function formatTalkMessage(array $data): array private function formatTalkMessage(array $data): array
{ {
$message = [ $message = [
"id" => 0,// 消息记录ID "id" => 0, // 消息记录ID
"source" => 1,// 消息来源[1:好友私信;2:群聊] "source" => 1, // 消息来源[1:好友私信;2:群聊]
"msg_type" => 1, "msg_type" => 1,
"user_id" => 0,// 发送者用户ID "user_id" => 0, // 发送者用户ID
"receive_id" => 0,// 接收者ID[好友ID或群ID] "receive_id" => 0, // 接收者ID[好友ID或群ID]
"content" => '',// 文本消息 "content" => '', // 文本消息
"is_revoke" => 0,// 消息是否撤销 "is_revoke" => 0, // 消息是否撤销
// 发送消息人的信息 // 发送消息人的信息
"nickname" => "",// 用户昵称 "nickname" => "", // 用户昵称
"avatar" => "",// 用户头像 "avatar" => "", // 用户头像
"group_name" => "",// 群组名称 "group_name" => "", // 群组名称
"group_avatar" => "",// 群组头像 "group_avatar" => "", // 群组头像
// 不同的消息类型 // 不同的消息类型
"file" => [], "file" => [],

View File

@ -34,7 +34,7 @@
"phper666/jwt-auth": "^3.0", "phper666/jwt-auth": "^3.0",
"hyperf/filesystem": "^2.0", "hyperf/filesystem": "^2.0",
"hashids/hashids": "^4.0", "hashids/hashids": "^4.0",
"ext-json": "^1.6", "ext-json": "*",
"hyperf/view": "^2.0", "hyperf/view": "^2.0",
"hyperf/view-engine": "^2.0", "hyperf/view-engine": "^2.0",
"phpmailer/phpmailer": "^6.2" "phpmailer/phpmailer": "^6.2"