Browse Source

调整短信依赖注入

master
lanzu_qsy 5 years ago
parent
commit
39ace4d2d0
  1. 5
      app/JsonRpc/AlismsService.php
  2. 7
      app/JsonRpc/SmsServiceInterface.php

5
app/JsonRpc/AlismsService.php

@ -4,7 +4,6 @@
namespace App\JsonRpc;
use App\Service\SmsAliService;
use Hyperf\RpcServer\Annotation\RpcService;
use Hyperf\Di\Annotation\Inject;
@ -17,7 +16,7 @@ class AlismsService implements SmsServiceInterface
{
/**
* @Inject
* @var SmsAliService
* @var \App\Service\SmsServiceInterface
*/
private $smsAliService;
@ -31,6 +30,6 @@ class AlismsService implements SmsServiceInterface
*/
public function sent($phone, $template, $templateParams, $signName = '懒族生活')
{
return $this->smsAliService->send($phone, $template, $templateParams, $signName = '懒族生活');
return $this->smsAliService->send($phone, $template, $templateParams);
}
}

7
app/JsonRpc/SmsServiceInterface.php

@ -6,5 +6,12 @@ namespace App\JsonRpc;
interface SmsServiceInterface
{
/**
* @param $phone
* @param $template
* @param $templateParams
* @param string $signName
* @return mixed
*/
public function sent($phone, $template, $templateParams, $signName='懒族生活');
}
Loading…
Cancel
Save