This commit is contained in:
58
app/Request/DeptRequest.php
Normal file
58
app/Request/DeptRequest.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/7/14
|
||||
* Time: 下午2:16
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Request;
|
||||
|
||||
class DeptRequest extends AbstractRequest
|
||||
{
|
||||
public array $scenes = [
|
||||
'addDept' => ['name', 'active_status', 'remark'],
|
||||
'updateDept' => ['id', 'name', 'active_status', 'remark'],
|
||||
'delDept' => ['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 [
|
||||
'id' => 'required|integer|min:1',
|
||||
'ids' => 'required|array|min:1',
|
||||
'ids.*' => 'required|integer|min:1',
|
||||
'name' => 'required|string|max:45',
|
||||
'remark' => 'string|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'name' => '部门名称',
|
||||
'remark' => '备注',
|
||||
'id' => '记录ID',
|
||||
'ids' => '记录ID列表',
|
||||
'ids.*' => '记录ID',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user