suyuan/app/adminapi/validate/device/AirMonitorValidate.php

112 lines
3.0 KiB
PHP
Raw Normal View History

2023-11-24 17:34:27 +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\device;
use app\common\validate\BaseValidate;
/**
* AirMonitor验证器
* Class AirMonitorValidate
* @package app\adminapi\validate\device
*/
class AirMonitorValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'device_id' => 'require',
'wind_direction' => 'require',
'wind_speed' => 'require',
'temperature' => 'require',
'moisture' => 'require',
'co2_content' => 'require',
'pressure' => 'require',
'rainfall' => 'require',
'light_intensity' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'device_id' => '设备ID',
'wind_direction' => '风向',
'wind_speed' => '风速',
'temperature' => '空气温度',
'moisture' => '空气湿度',
'co2_content' => '二氧化碳含量',
'pressure' => '大气压强',
'rainfall' => '降雨量',
'light_intensity' => '光照强度',
];
/**
* @notes 添加场景
* @return AirMonitorValidate
* @author likeadmin
* @date 2023/11/24 16:49
*/
public function sceneAdd()
{
return $this->only(['device_id','wind_direction','wind_speed','temperature','moisture','co2_content','pressure','rainfall','light_intensity']);
}
/**
* @notes 编辑场景
* @return AirMonitorValidate
* @author likeadmin
* @date 2023/11/24 16:49
*/
public function sceneEdit()
{
return $this->only(['id','device_id','wind_direction','wind_speed','temperature','moisture','co2_content','pressure','rainfall','light_intensity']);
}
/**
* @notes 删除场景
* @return AirMonitorValidate
* @author likeadmin
* @date 2023/11/24 16:49
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return AirMonitorValidate
* @author likeadmin
* @date 2023/11/24 16:49
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}