<?php


namespace app\admin\validate;


class ExpressionValidate extends BaseValidate
{

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

    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'expression_id' => '常用语ID',
        'category_id' => '分类ID',
        'name' => '常用语名称',
        'img' => '图片',
        'weight' => '权重',
    ];

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

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

}