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

134 lines
4.6 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;
/**
* MonitorThreshold验证器
* Class MonitorThresholdValidate
* @package app\adminapi\validate\device
*/
class MonitorThresholdValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'soil_temp_max' => 'require',
'soil_temp_min' => 'require',
'soil_mois_max' => 'require',
'soil_mois_min' => 'require',
'soil_ph_max' => 'require',
'soil_ph_min' => 'require',
'soil_n_content_max' => 'require',
'soil_n_content_min' => 'require',
'soil_p_content_max' => 'require',
'soil_p_content_min' => 'require',
'soil_k_content_max' => 'require',
'soil_k_content_min' => 'require',
'air_temp_max' => 'require',
'air_temp_min' => 'require',
'air_mois_max' => 'require',
'air_mois_min' => 'require',
'air_co2_content_max' => 'require',
'air_co2_content_min' => 'require',
'wind_speed_max' => 'require',
'wind_speed_min' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'soil_temp_max' => '土壤最高温度',
'soil_temp_min' => '土壤最低温度',
'soil_mois_max' => '土壤最高湿度',
'soil_mois_min' => '土壤最低湿度',
'soil_ph_max' => '土壤最高PH值',
'soil_ph_min' => '土壤最低PH值',
'soil_n_content_max' => '土壤最高氮含量',
'soil_n_content_min' => '土壤最低氮含量',
'soil_p_content_max' => '土壤最高磷含量',
'soil_p_content_min' => '土壤最低磷含量',
'soil_k_content_max' => '土壤最高钾含量',
'soil_k_content_min' => '土壤最低钾含量',
'air_temp_max' => '空气最高温度',
'air_temp_min' => '空气最低温度',
'air_mois_max' => '空气最高湿度',
'air_mois_min' => '空气最低湿度',
'air_co2_content_max' => '空气最大二氧化碳含量',
'air_co2_content_min' => '空气最小二氧化碳含量',
'wind_speed_max' => '最大风速',
'wind_speed_min' => '最小风速',
];
/**
* @notes 添加场景
* @return MonitorThresholdValidate
* @author likeadmin
* @date 2023/11/24 16:17
*/
public function sceneAdd()
{
return $this->only(['soil_temp_max','soil_temp_min','soil_mois_max','soil_mois_min','soil_ph_max','soil_ph_min','soil_n_content_max','soil_n_content_min','soil_p_content_max','soil_p_content_min','soil_k_content_max','soil_k_content_min','air_temp_max','air_temp_min','air_mois_max','air_mois_min','air_co2_content_max','air_co2_content_min','wind_speed_max','wind_speed_min']);
}
/**
* @notes 编辑场景
* @return MonitorThresholdValidate
* @author likeadmin
* @date 2023/11/24 16:17
*/
public function sceneEdit()
{
return $this->only(['id','soil_temp_max','soil_temp_min','soil_mois_max','soil_mois_min','soil_ph_max','soil_ph_min','soil_n_content_max','soil_n_content_min','soil_p_content_max','soil_p_content_min','soil_k_content_max','soil_k_content_min','air_temp_max','air_temp_min','air_mois_max','air_mois_min','air_co2_content_max','air_co2_content_min','wind_speed_max','wind_speed_min']);
}
/**
* @notes 删除场景
* @return MonitorThresholdValidate
* @author likeadmin
* @date 2023/11/24 16:17
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return MonitorThresholdValidate
* @author likeadmin
* @date 2023/11/24 16:17
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}