Art.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\api\validate;
  3. use think\Validate;
  4. class Art extends Validate
  5. {
  6. protected $rule = [
  7. 'art_id' => 'require|number|between:0,' . PHP_INT_MAX,
  8. 'offset' => 'number|between:0,' . PHP_INT_MAX,
  9. 'limit' => 'number|between:1,500',
  10. 'tag' => 'max:100',
  11. 'orderby' => 'in:id,time,time_add,score,hits,hits_day,hits_week,hits_month,up,down,level',
  12. 'letter' => 'max:1',
  13. 'status' => 'number|between:1,10',
  14. 'name' => 'max:100',
  15. 'sub' => 'max:100',
  16. 'blurb' => 'max:100',
  17. 'title' => 'max:50',
  18. 'content' => 'max:100',
  19. 'time_start' => 'number|between:1,' . PHP_INT_MAX,
  20. 'time_end' => 'number|between:1,' . PHP_INT_MAX,
  21. ];
  22. protected $message = [
  23. ];
  24. protected $scene = [
  25. 'get_list' => [
  26. 'offset',
  27. 'limit',
  28. 'tag',
  29. 'orderby',
  30. 'letter',
  31. 'status',
  32. 'name',
  33. 'sub',
  34. 'blurb',
  35. 'title',
  36. 'content',
  37. 'time_start',
  38. 'time_end',
  39. ],
  40. 'get_detail' => [
  41. 'art_id',
  42. ],
  43. ];
  44. }