hyperf-chat/app/Amqp/Producer/ChatMessageProducer.php

29 lines
549 B
PHP
Raw Normal View History

2020-11-02 22:45:37 +08:00
<?php
declare(strict_types=1);
namespace App\Amqp\Producer;
use Hyperf\Amqp\Message\ProducerMessage;
use Hyperf\Amqp\Message\Type;
2020-11-04 11:57:16 +08:00
class ChatMessageProducer extends ProducerMessage
2020-11-02 22:45:37 +08:00
{
public $exchange = 'im.message.fanout';
public $type = Type::FANOUT;
public function __construct($data)
{
2020-11-04 07:54:11 +08:00
$message = [
'method'=>'', //
'sender'=>'', // 发送者
'receive'=>'', // 接收者
'receiveType'=>'',
'message'=>[]
];
2020-11-02 22:45:37 +08:00
$this->payload = $data;
}
}