46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request;
|
|
|
|
use App\Constants\HttpEnumCode;
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class PatientDoctorRequest extends FormRequest
|
|
{
|
|
protected array $scenes = [
|
|
'getInquiryDoctorList' => ['expertise_id','province_id','city_id','sort_order','keyword'],
|
|
];
|
|
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'sort_order' => 'sometimes|integer|min:1|max:5',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 获取已定义验证规则的错误消息.
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'sort_order.integer' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
|
'sort_order.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
|
'sort_order.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
|
];
|
|
}
|
|
}
|