Files
wh-api/app/Request/DeptRequest.php
ykxiao 0567eda8ca
Some checks failed
Build Docker / build (push) Has been cancelled
增加部门管理接口
2025-07-14 14:37:32 +08:00

58 lines
1.3 KiB
PHP

<?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',
];
}
}