WokerTask/app/adminapi/validate/user/UserMenuValidate.php

111 lines
2.8 KiB
PHP
Raw Normal View History

2023-12-27 14:06:33 +08:00
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\validate\user;
use app\common\validate\BaseValidate;
/**
* 用户菜单验证器
* Class UserMenuValidate
* @package app\adminapi\validate\user
*/
class UserMenuValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'pid' => 'require',
'type' => 'require',
'name' => 'require',
'icon' => 'require',
'sort' => 'require',
'paths' => 'require',
'is_show' => 'require',
'is_disable' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'pid' => '上级菜单',
'type' => '权限类型: M=目录C=菜单A=按钮',
'name' => '菜单名称',
'icon' => '菜单图标',
'sort' => '菜单排序',
'paths' => '路由地址',
'params' => '路由参数',
'is_show' => '是否显示: 0=否, 1=是',
'is_disable' => '是否禁用: 0=否, 1=是',
];
/**
* @notes 添加场景
* @return UserMenuValidate
* @author likeadmin
* @date 2023/08/23 09:38
*/
public function sceneAdd()
{
return $this->only(['pid','type','name','icon','sort','paths','params','is_show','is_disable']);
}
/**
* @notes 编辑场景
* @return UserMenuValidate
* @author likeadmin
* @date 2023/08/23 09:38
*/
public function sceneEdit()
{
return $this->only(['id','pid','type','name','icon','sort','paths','params','is_show','is_disable']);
}
/**
* @notes 删除场景
* @return UserMenuValidate
* @author likeadmin
* @date 2023/08/23 09:38
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return UserMenuValidate
* @author likeadmin
* @date 2023/08/23 09:38
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}