CrontabValidate.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | saiadmin [ saiadmin快速开发框架 ]
  4. // +----------------------------------------------------------------------
  5. // | Author: sai <1430792918@qq.com>
  6. // +----------------------------------------------------------------------
  7. namespace plugin\saiadmin\app\validate\tool;
  8. use think\Validate;
  9. /**
  10. * 字典类型验证器
  11. */
  12. class CrontabValidate extends Validate
  13. {
  14. /**
  15. * 定义验证规则
  16. */
  17. protected $rule = [
  18. 'name' => 'require',
  19. 'type' => 'require',
  20. 'target' => 'require',
  21. 'status' => 'require',
  22. ];
  23. /**
  24. * 定义错误信息
  25. */
  26. protected $message = [
  27. 'name' => '任务名称必须填写',
  28. 'type' => '任务类型必须填写',
  29. 'target' => '调用目标必须填写',
  30. 'status' => '状态必须填写',
  31. ];
  32. /**
  33. * 定义场景
  34. */
  35. protected $scene = [
  36. 'save' => [
  37. 'name',
  38. 'type',
  39. 'target',
  40. 'status',
  41. ],
  42. 'update' => [
  43. 'name',
  44. 'type',
  45. 'target',
  46. 'status',
  47. ],
  48. ];
  49. }