68 lines
1.2 KiB
PHP
68 lines
1.2 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace App\System\Request;
|
|
|
|
use Builder\FormRequest;
|
|
|
|
class SystemPostRequest extends FormRequest
|
|
{
|
|
/**
|
|
* 公共规则
|
|
*/
|
|
public function commonRules(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
|
|
/**
|
|
* 新增数据验证规则
|
|
* return array
|
|
*/
|
|
public function saveRules(): array
|
|
{
|
|
return [
|
|
'name' => 'required|max:30',
|
|
'code' => 'required|min:3|max:100',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 更新数据验证规则
|
|
* return array
|
|
*/
|
|
public function updateRules(): array
|
|
{
|
|
return [
|
|
'name' => 'required|max:30',
|
|
'code' => 'required|min:3|max:100',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 修改状态数据验证规则
|
|
* return array
|
|
*/
|
|
public function changeStatusRules(): array
|
|
{
|
|
return [
|
|
'id' => 'required',
|
|
'status' => 'required'
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 字段映射名称
|
|
* return array
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'id' => '岗位ID',
|
|
'name' => '岗位名称',
|
|
'code' => '岗位标识',
|
|
'status' => '岗位状态',
|
|
];
|
|
}
|
|
|
|
} |