新增订阅消息队列+短信发送队列

This commit is contained in:
2023-03-03 19:35:57 +08:00
parent cbf78278b5
commit 7740dad0e5
19 changed files with 689 additions and 16 deletions
@@ -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;
}
}