新增医生设置视频预约时间 及延迟通知队列
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
// 短信发送
|
||||
use App\Amqp\Producer\SendSmsMessageProducer;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Utils\Log;
|
||||
use Extend\Alibaba\Dysms;
|
||||
use Hyperf\Amqp\Producer;
|
||||
use Hyperf\Context\ApplicationContext;
|
||||
|
||||
class SendSmsService extends BaseService
|
||||
{
|
||||
public string $mobile;
|
||||
public function __construct(string|int $mobile)
|
||||
{
|
||||
if (!empty($mobile)){
|
||||
$this->mobile = $mobile;
|
||||
}
|
||||
}
|
||||
|
||||
// 患者-通知患者视频时间
|
||||
public function noticePatientVideoTime(string $doctor_name,$reservation_time){
|
||||
try {
|
||||
// 发送短信-患者-视频预约成功
|
||||
$template_code = "SMS_464481352";
|
||||
$scene_desc = "通知患者视频时间";
|
||||
|
||||
$template_param = array();
|
||||
$template_param['name'] = $doctor_name;
|
||||
$template_param['time'] = date('Y-m-d H:i', strtotime($reservation_time));
|
||||
|
||||
Dysms::sendSms($this->mobile,$template_param,$template_code,$scene_desc);
|
||||
}catch (\Throwable $e){
|
||||
throw new BusinessException("短信发送失败",HttpEnumCode::CODE_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
// 患者-通知患者视频
|
||||
public function noticePatientVideo(string $doctor_name){
|
||||
try {
|
||||
// 发送短信-患者-视频预约成功
|
||||
$template_code = "SMS_464436348";
|
||||
$scene_desc = "通知患者视频";
|
||||
|
||||
$template_param = array();
|
||||
$template_param['name'] = $doctor_name;
|
||||
|
||||
Dysms::sendSms($this->mobile,$template_param,$template_code,$scene_desc);
|
||||
}catch (\Throwable $e){
|
||||
throw new BusinessException("短信发送失败",HttpEnumCode::CODE_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
// 医生-通知医生视频
|
||||
public function noticeDoctorVideo(string $patient_name){
|
||||
try {
|
||||
// 发送短信-患者-视频预约成功
|
||||
$template_code = "SMS_464486306";
|
||||
$scene_desc = "通知医生视频";
|
||||
|
||||
$template_param = array();
|
||||
$template_param['name'] = $patient_name;
|
||||
|
||||
Dysms::sendSms($this->mobile,$template_param,$template_code,$scene_desc);
|
||||
}catch (\Throwable $e){
|
||||
throw new BusinessException("短信发送失败",HttpEnumCode::CODE_FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user