新增订阅消息队列+短信发送队列
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Amqp\Producer;
|
||||
|
||||
use Hyperf\Amqp\Annotation\Producer;
|
||||
use Hyperf\Amqp\Message\ProducerMessage;
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
*/
|
||||
#[Producer(exchange: 'amqp.direct', routingKey: 'SendSmsMessage')]
|
||||
class SendSmsMessageProducer extends ProducerMessage
|
||||
{
|
||||
public function __construct($data)
|
||||
{
|
||||
$this->payload = $data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user