BaseSmss.php 1.6 KB

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