Notices.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace App\Http\Requests\Manager\Process;
  3. use App\Http\Requests\BaseRequest;
  4. /**
  5. * 通知处理请求类
  6. * @author 唐远望
  7. * @version 1.0
  8. * @date 2026-03-21
  9. *
  10. */
  11. class Notices extends BaseRequest
  12. {
  13. /**
  14. * 获取应用于请求的规则
  15. *
  16. * @return array
  17. */
  18. public function rules()
  19. {
  20. // 返回结果
  21. return [
  22. 'name' => 'required',
  23. 'id' => 'required|integer|gt:0',
  24. 'status' => 'required|integer|in:0,1',
  25. 'page' => 'integer|min:1',
  26. 'limit' => 'integer|min:1',
  27. 'status' => 'required|integer|in:0,1',
  28. ];
  29. }
  30. // 场景列表
  31. protected $scenes = [
  32. 'detail' => ['id'],
  33. 'list' => ['page', 'limit'],
  34. 'add' => [],
  35. 'edit' => [],
  36. 'set_status' => ['id', 'status'],
  37. 'set_processing_status' => ['id'],
  38. 'delete' => ['id'],
  39. 'data_cleaning' => [''],
  40. 'export_excel' => ['']
  41. ];
  42. /**
  43. * 获取已定义验证规则的错误消息
  44. *
  45. * @return array
  46. */
  47. public function messages()
  48. {
  49. return [
  50. 'name.required' => '名称必填',
  51. 'id.required' => 'ID未知',
  52. 'id.integer' => 'ID格式错误',
  53. 'id.gt' => 'ID格式错误',
  54. 'status.required' => '状态未知',
  55. 'status.integer' => '状态格式错误',
  56. 'status.in' => '状态格式错误',
  57. 'page.integer' => '页码格式错误',
  58. 'page.min' => '页码格式错误',
  59. 'limit.integer' => '每页数量格式错误',
  60. 'limit.min' => '每页数量格式错误',
  61. ];
  62. }
  63. }