BaseSms.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace basic;
  12. use service\AccessTokenServeService;
  13. /**
  14. * Class BaseSmss
  15. * @package crmeb\basic
  16. */
  17. abstract class BaseSms extends BaseStorage
  18. {
  19. /**
  20. * access_token
  21. * @var null
  22. */
  23. protected $accessToken = NULL;
  24. public function __construct($name, AccessTokenServeService $accessTokenServeService,$configFile)
  25. {
  26. $this->accessToken = $accessTokenServeService;
  27. $this->name = $name;
  28. $this->configFile = $configFile;
  29. $this->initialize();
  30. }
  31. /**
  32. * @param array $config
  33. * @return mixed|void
  34. */
  35. protected function initialize(array $config = [])
  36. {
  37. }
  38. /**
  39. * 开通服务
  40. * @return mixed
  41. */
  42. abstract public function open();
  43. /**
  44. * 修改
  45. * @return mixed
  46. */
  47. abstract public function modify($sign);
  48. /**
  49. * 信息
  50. * @return mixed
  51. */
  52. abstract public function info();
  53. /**
  54. * 发送短信
  55. * @return mixed
  56. */
  57. abstract public function send($phone, $templateId, $data);
  58. /**
  59. * 模版
  60. * @return mixed
  61. */
  62. abstract public function temps($page, $limit);
  63. /**
  64. * 申请模版
  65. * @return mixed
  66. */
  67. abstract public function apply($title, $content, $type);
  68. /**
  69. * 申请模版记录
  70. * @return mixed
  71. */
  72. abstract public function applys($temp_type, $page, $limit);
  73. /**
  74. * 发送记录
  75. * @return mixed
  76. */
  77. abstract public function record($record_id);
  78. }