<?php

namespace app\api\validate;
use app\common\validate\BaseValidate;

/**
 * @author 林海涛
 * @date 2024/7/19 下午5:11
 */
class UploadFileValidate extends BaseValidate
{
    protected $rule = [
        'cid' => 'require',
        'source' => 'require',
        'file_type' => 'require',
    ];
    protected $message = [
        'cid.require' => '文件分类不存在',
        'files.require' => '文件缺失',
        'files.array' => '文件必须为数组',
        'source.require' => '文件来源不能为空',
        'file_type' => '文件类型',
    ];

    public function sceneUploadFile()
    {
        return $this->only(['cid','source','file_type']);
    }

    public function sceneUploadFiles()
    {
        return $this->only(['cid','source']);
    }
}