|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Bside\Import;
|
|
|
|
|
|
|
|
use App\Models\Import\ImportTask;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 产品新闻博客导入任务
|
|
|
|
* @author:akun
|
|
|
|
* @time 2023/9/20 11:32
|
|
|
|
* Class NavRequest
|
|
|
|
* @package App\Http\Requests\Bside\Nav
|
|
|
|
*/
|
|
|
|
class ImportTaskRequest extends FormRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'type' => ['required', Rule::in([ImportTask::TYPE_PROJECT, ImportTask::TYPE_NEWS, ImportTask::TYPE_BLOG])],
|
|
|
|
'file_url' => ['required'],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function messages()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'type.required' => '导入类型必须',
|
|
|
|
'type.in' => '导入类型错误',
|
|
|
|
'file_url.required' => '文件地址必须',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|