Smser.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. namespace Aix\Sms\Contracts;
  3. use App\Models\SmsTemplate;
  4. /**
  5. * 短信契约,新的短实例需要实现该接口
  6. * Interface Smser
  7. * @package Aix\Sms\Contracts
  8. */
  9. interface Smser
  10. {
  11. /**
  12. * 用户验证身份短信模板
  13. */
  14. const TEMPLATE_TEST="sms_testing";
  15. /**
  16. * 用户验证身份短信模板
  17. */
  18. const TEMPLATE_AUTH_CHECK="sms_auth_check";
  19. /**
  20. * 用户登录短信模板
  21. */
  22. const TEMPLATE_AUTH_LOGIN="sms_auth_login";
  23. /**
  24. * 用户注册短信模板
  25. */
  26. const TEMPLATE_AUTH_REGISTER="sms_auth_register";
  27. /**
  28. * 用户申请职位模板
  29. */
  30. const TEMPLATE_JOB_APPLY="sms_applyjobs";
  31. /**
  32. * 面试邀请模板
  33. */
  34. const TEMPLATE_JOB_INVITE="sms_invite";
  35. /**
  36. * 申请充值
  37. */
  38. const TEMPLATE_SMS_ORDER ='sms_order';
  39. /**
  40. * 快速注册
  41. */
  42. const TEMPLATE_SMS_QUICK_REGISTER = 'sms_quick_register';
  43. /**
  44. * 重置密码
  45. */
  46. const TEMPLATE_SMS_EDITPWD = 'sms_editpwd';
  47. /**
  48. *营业执照审核通过
  49. */
  50. const TEMPLATE_SMS_LICENSEALLOW = 'sms_licenseallow';
  51. /**
  52. * 营业执照审核未通过
  53. */
  54. const TEMPLATE_SMS_LICENSENOTALLOW = 'sms_licensenotallow';
  55. /**
  56. * 职位审核通过
  57. */
  58. const TEMPLATE_SMS_JOBSALLOW = 'sms_jobsallow';
  59. /**
  60. * 职位审核未通过
  61. */
  62. const TEMPLATE_SMS_JOBSNOTALLOW = 'sms_jobsnotallow';
  63. /**
  64. * 招聘会预定成功
  65. */
  66. const TEMPLATE_JOBFAIR_APPLY_OK="sms_jobfair_apply_ok";
  67. /**
  68. * 招聘会预定成功
  69. */
  70. const TEMPLATE_JOBFAIR_APPLY_ERROR="sms_jobfair_apply_error";
  71. /**
  72. * 发送基本短信
  73. * @param string $mobile
  74. * @param SmsTemplate $template
  75. * @param array $params
  76. * @return bool
  77. */
  78. public function sendSms(string $mobile, SmsTemplate $template, array $params = []): bool ;
  79. /**
  80. * 发送确认短信,需要缓存验证码code
  81. * @param string $mobile
  82. * @param SmsTemplate $template
  83. * @return bool
  84. */
  85. public function sendAuthSms(string $mobile, SmsTemplate $template): bool ;
  86. /**
  87. * 批量发送短信
  88. * @param array $mobiles
  89. * @param SmsTemplate $template
  90. * @param array $params
  91. * @return bool
  92. */
  93. public function sendBatchSms(array $mobiles, SmsTemplate $template, array $params = []): bool ;
  94. }