You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
833 B

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request;
  4. use Hyperf\Validation\Request\FormRequest;
  5. class UserOrdersRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. */
  10. public function authorize(): bool
  11. {
  12. return true;
  13. }
  14. /**
  15. * Get the validation rules that apply to the request.
  16. */
  17. public function rules(): array
  18. {
  19. return [
  20. 'user_id' => 'required|nonempty|integer',
  21. 'market_id' => 'required|nonempty|integer',
  22. 'state' => 'required',
  23. 'page' => 'required|nonempty|integer',
  24. 'pagesize' => 'required|nonempty|integer',
  25. ];
  26. }
  27. public function messages(): array
  28. {
  29. return [
  30. '*.*' => ':attribute 参数不正确',
  31. ];
  32. }
  33. }