hospital-applets-api/app/Request/DetectionRequest.php

50 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Request;
use App\Constants\HttpEnumCode;
use Hyperf\Validation\Request\FormRequest;
class DetectionRequest extends FormRequest
{
protected array $scenes = [
'addDetectionOrder' => [ // 创建检测订单
'company_id',
'patient_id',
'family_id',
'nation_id',
'detection_disease_class_ids',
],
];
/**
* 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 [
'detection_project_id' => 'required',
];
}
/**
* 获取已定义验证规则的错误消息.
*/
public function messages(): array
{
return [
'company_id.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
];
}
}