<?php


namespace app\admin\validate;


class IpConfigValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'ip' => 'require|ip',
        'type' => 'require|in:1,2',
        'status' => 'integer|in:0,1',
        'remark' => 'length:0,200',
    ];
    

    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'ip' => 'IP地址',
        'type' => '类型',
        'status' => '状态',
        'remark' => '备注',
    ];

    /**
     * @notes 编辑场景
     */
    public function sceneEdit()
    {
        return $this->only(['ip', 'type', 'status', 'remark']);
    }

    public function sceneId()
    {
        return $this->only(['id']);
    }

    public function sceneStatus()
    {
        return $this->only(['id', 'field']);
    }

}