<?php


namespace app\admin\validate;


class DedicatedLineValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'name' => 'require|length:1,100',
        'weight' => 'require|integer|min:0',
        'is_rec' => 'integer|in:0,1',
        'keyword' => 'length:0,200',
    ];

    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'name' => '专线名称',
        'weight' => '权重',
        'is_rec' => '是否推荐',
        'keyword' => '关键词',
    ];

    /**
     * @notes 编辑场景
     */
    public function sceneEdit()
    {
        return $this->only(['name', 'weight', 'language_code','is_rec','keyword']);
    }

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

}