新增获取合作公司检测项目列表接口

This commit is contained in:
2023-07-26 15:50:46 +08:00
parent 98b442ca61
commit d7adc01b84
6 changed files with 269 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace App\Request;
use App\Constants\HttpEnumCode;
use Hyperf\Validation\Request\FormRequest;
class DetectionRequest extends FormRequest
{
protected array $scenes = [
'getDetectionProjectList' => [ // 获取合作公司检测项目列表
'company_id',
],
];
/**
* 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 [
'company_id' => 'required',
'detection_project_id' => 'required',
];
}
/**
* 获取已定义验证规则的错误消息.
*/
public function messages(): array
{
return [
'company_id.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
];
}
}