SmsConfigValidate.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\validate\notice;
  20. use app\common\validate\BaseValidate;
  21. class SmsConfigValidate extends BaseValidate
  22. {
  23. protected $rule = [
  24. 'type' => 'require',
  25. 'sign' => 'require',
  26. 'app_id' => 'requireIf:type,tencent',
  27. 'app_key' => 'requireIf:type,ali',
  28. 'secret_id' => 'requireIf:type,tencent',
  29. 'secret_key' => 'require',
  30. 'status' => 'require',
  31. ];
  32. protected $message = [
  33. 'type.require' => '请选择类型',
  34. 'sign.require' => '请输入签名',
  35. 'app_id.requireIf' => '请输入app_id',
  36. 'app_key.requireIf' => '请输入app_key',
  37. 'secret_id.requireIf' => '请输入secret_id',
  38. 'secret_key.require' => '请输入secret_key',
  39. 'status.require' => '请选择状态',
  40. ];
  41. /**
  42. * @notes 查看短信配置详情场景
  43. * @return SmsConfigValidate
  44. * @author Tab
  45. * @date 2021/8/19 11:59
  46. */
  47. protected function sceneDetail()
  48. {
  49. return $this->only(['type']);
  50. }
  51. }