You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
54 lines
1.2 KiB
<?php |
|
|
|
namespace Plugins\Notebook\Request; |
|
|
|
use App\Request\AbstractRequest; |
|
|
|
class NotebookRequest extends AbstractRequest |
|
{ |
|
protected function allRules(): array |
|
{ |
|
return [ |
|
"id" => ["required"], |
|
"title" => ["required"], |
|
"content" => ["required"], |
|
"administrators_id" => ["required"], |
|
"latest_administrators_id" => ["required"], |
|
]; |
|
} |
|
|
|
public function attributes(): array |
|
{ |
|
return [ |
|
"id" => 'ID', |
|
"title" => '标题', |
|
"content" => '内容', |
|
"administrators_id" => '创建人', |
|
"latest_administrators_id" => '最后修改人', |
|
]; |
|
} |
|
|
|
/** |
|
* @return string[] |
|
*/ |
|
public function updateScene(): array |
|
{ |
|
return ["title"]; |
|
} |
|
|
|
/** |
|
* @return string[] |
|
*/ |
|
public function storeScene(): array |
|
{ |
|
return ["title"]; |
|
} |
|
|
|
/** |
|
* @return string[] |
|
*/ |
|
public function destroyScene(): array |
|
{ |
|
return ['ids']; |
|
} |
|
}
|
|
|