<?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
{
    /**
     * @param $data
     * [
     *      "template_code" => "SMS_123",
     *      "template_param" => [
     *          // 参数不确定，主要看短信模版的不同
     *      ],
     *      "scene_desc" => "场景描述",
     *      "phone" => "手机号",
     *      "user_id" => "用户id（被推送者）"
     * ]
     */
    public function __construct($data)
    {
        $this->payload = $data;
    }
}
