BaseSms.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace core\sms;
  12. use core\loader\Storage;
  13. /**
  14. * Class BaseSms
  15. * @package
  16. */
  17. abstract class BaseSms extends Storage
  18. {
  19. /**
  20. * 初始化
  21. * @param array $config
  22. * @return void
  23. */
  24. protected function initialize(array $config = [])
  25. {
  26. }
  27. /**
  28. * 发送短信
  29. * @param string $mobile
  30. * @param string $template_id
  31. * @param array $data
  32. * @return mixed
  33. */
  34. abstract public function send(string $mobile, string $template_id, array $data);
  35. /**
  36. * 编辑签名
  37. * @return mixed
  38. */
  39. abstract public function modify(string $sign = null, string $mobile, string $code);
  40. /**
  41. * 短信模板
  42. * @param int $page
  43. * @param int $limit
  44. * @param int $type
  45. * @return mixed
  46. */
  47. abstract public function template(int $page, int $limit, int $type);
  48. /**
  49. * 申请短信
  50. * @param string $title
  51. * @param string $content
  52. * @param int $type
  53. * @return mixed
  54. */
  55. abstract public function apply(string $title, string $content, int $type);
  56. /**
  57. * 模板列表
  58. * @param int $type
  59. * @param int $page
  60. * @param int $limit
  61. * @return mixed
  62. */
  63. abstract public function localTemplate(int $type, int $page, int $limit);
  64. /**
  65. * 记录
  66. * @param $id
  67. * @return mixed
  68. */
  69. abstract public function record($id);
  70. }