41 lines
898 B
PHP
41 lines
898 B
PHP
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
namespace App\Amqp\Producer;
|
||
|
||
use App\Model\SubTemplate;
|
||
use Hyperf\Amqp\Annotation\Producer;
|
||
use Hyperf\Amqp\Message\ProducerMessage;
|
||
|
||
/**
|
||
* 发送订阅消息
|
||
*/
|
||
#[Producer(exchange: 'amqp.direct', routingKey: 'SendSubMessage')]
|
||
class SendSubMessageProducer extends ProducerMessage
|
||
{
|
||
/**
|
||
* @param array $data
|
||
* [
|
||
* "push_user_id" // 用户id(被推送者)
|
||
* "template_title" // 推送的模版名称
|
||
* "params" => [ // 推送所需的参数
|
||
* "page" // 跳转页面
|
||
* "data" => [
|
||
* "thing1" => [
|
||
* "value" => [
|
||
* "参数1"
|
||
* ]
|
||
* ]
|
||
* ]
|
||
*
|
||
* ]
|
||
* ]
|
||
*/
|
||
public function __construct(array $data)
|
||
{
|
||
$this->payload = $data;
|
||
}
|
||
|
||
}
|