hospital-applets-api/app/Amqp/Producer/SendSubMessageProducer.php

41 lines
898 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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;
}
}