You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BaseSmss.php 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. namespace crmeb\basic;
  3. use crmeb\services\AccessTokenServeService;
  4. /**
  5. * Class BaseSmss
  6. */
  7. abstract class BaseSmss extends BaseStorage
  8. {
  9. /**
  10. * access_token
  11. * @var null
  12. */
  13. protected $accessToken = NULL;
  14. /**
  15. * BaseSmss constructor.
  16. * @param string $name
  17. * @param AccessTokenServeService $accessTokenServeService
  18. * @param string $configFile
  19. */
  20. public function __construct(string $name, AccessTokenServeService $accessTokenServeService, string $configFile)
  21. {
  22. $this->accessToken = $accessTokenServeService;
  23. $this->name = $name;
  24. $this->configFile = $configFile;
  25. $this->initialize();
  26. }
  27. /**
  28. * 初始化
  29. * @param array $config
  30. * @return mixed|void
  31. */
  32. protected function initialize(array $config = [])
  33. {
  34. }
  35. /**
  36. * 开通服务
  37. * @return mixed
  38. */
  39. abstract public function open();
  40. /**修改签名
  41. * @return mixed
  42. */
  43. abstract public function modify(string $sign = null, string $phone, string $code);
  44. /**用户信息
  45. * @return mixed
  46. */
  47. abstract public function info();
  48. /**发送短信
  49. * @return mixed
  50. */
  51. abstract public function send(string $phone, string $templateId, array $data);
  52. /**
  53. * 短信模板
  54. * @param int $page
  55. * @param int $limit
  56. * @param int $type
  57. * @return mixed
  58. */
  59. abstract public function temps(int $page, int $limit, int $type);
  60. /**
  61. * 申请模板
  62. * @param string $title
  63. * @param string $content
  64. * @param int $type
  65. * @return mixed
  66. */
  67. abstract public function apply(string $title, string $content, int $type);
  68. /**
  69. * 模板记录
  70. * @param int $tempType
  71. * @param int $page
  72. * @param int $limit
  73. * @return mixed
  74. */
  75. abstract public function applys(int $tempType, int $page, int $limit);
  76. /**发送记录
  77. * @return mixed
  78. */
  79. abstract public function record($record_id);
  80. }