first commit
This commit is contained in:
91
app/adminapi/validate/user/UserNoticeValidate.php
Normal file
91
app/adminapi/validate/user/UserNoticeValidate.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
namespace app\adminapi\validate\user;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 用户消息验证器
|
||||
* Class UserNoticeValidate
|
||||
* @package app\adminapi\validate\user
|
||||
*/
|
||||
class UserNoticeValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'user_id' => 'require',
|
||||
'title' => 'require',
|
||||
'content' => 'require',
|
||||
'notice_type' => 'require',
|
||||
'langs' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'user_id' => '用户id',
|
||||
'title' => '标题',
|
||||
'content' => '内容',
|
||||
'notice_type' => '消息类型',
|
||||
'langs' => '多语言存储',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return UserNoticeValidate
|
||||
* @author BD
|
||||
* @date 2024/05/26 00:36
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['user_id','title','content','read','notice_type','langs']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return UserNoticeValidate
|
||||
* @author BD
|
||||
* @date 2024/05/26 00:36
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id','user_id','title','content','read','notice_type','langs']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return UserNoticeValidate
|
||||
* @author BD
|
||||
* @date 2024/05/26 00:36
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return UserNoticeValidate
|
||||
* @author BD
|
||||
* @date 2024/05/26 00:36
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user