Product.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace App\Http\Requests\Manager\CollectSync;
  3. use App\Http\Requests\BaseRequest;
  4. /**
  5. * 采集数据同步
  6. * @author 唐远望
  7. * @version 1.0
  8. * @date 2026-02-05
  9. *
  10. */
  11. class Product 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. 'image_url' => 'required',
  28. 'link_url' => 'required',
  29. ];
  30. }
  31. // 场景列表
  32. protected $scenes = [
  33. 'detail' => ['id'],
  34. 'list' => ['page', 'limit'],
  35. 'add' => [],
  36. 'edit' => [],
  37. 'data_cleadata_ysbang_syncning' =>[],
  38. 'data_yycheng_sync_syncning' =>[],
  39. 'data_jd_tmall_sync_syncning' =>[]
  40. ];
  41. /**
  42. * 获取已定义验证规则的错误消息
  43. *
  44. * @return array
  45. */
  46. public function messages()
  47. {
  48. return [
  49. 'name.required' => '名称必填',
  50. 'id.required' => 'ID未知',
  51. 'id.integer' => 'ID格式错误',
  52. 'id.gt' => 'ID格式错误',
  53. 'status.required' => '状态未知',
  54. 'status.integer' => '状态格式错误',
  55. 'status.in' => '状态格式错误',
  56. 'page.integer' => '页码格式错误',
  57. 'page.min' => '页码格式错误',
  58. 'limit.integer' => '每页数量格式错误',
  59. 'limit.min' => '每页数量格式错误',
  60. ];
  61. }
  62. }