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.

45 lines
888 B

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request;
  4. use Hyperf\Validation\Request\FormRequest;
  5. class CommunityBindRequest 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. 'source_id' => 'required|nonempty',
  21. 'user_id' => 'required|nonempty|exists_enable:ims_cjdc_user,id',
  22. 'json_data' => 'json',
  23. ];
  24. }
  25. public function messages(): array
  26. {
  27. return [
  28. '*.nonempty' => ':attribute参数异常',
  29. 'user_id.exists_enable' => '用户不存在',
  30. ];
  31. }
  32. public function attributes(): array
  33. {
  34. return [
  35. ];
  36. }
  37. }