/**
 * Copyright (c) 2018 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package com.dianguang.cloud.ossservice.service;


import com.dianguang.cloud.ossservice.config.CloudStorageConfig;
import com.dianguang.cloud.ossservice.model.Constant;

/**
 * 文件上传Factory
 * @author Mark sunlightcs@gmail.com
 */
public final class OSSFactory {
    public static AbstractCloudStorageService build(CloudStorageConfig config){

        if(config.getType() == Constant.CloudService.QINIU.getValue()){
            return new QiniuCloudStorageService(config);
        }else if(config.getType() == Constant.CloudService.ALIYUN.getValue()){
            return new AliyunCloudStorageService(config);
        }else if(config.getType() == Constant.CloudService.QCLOUD.getValue()){
            return new QcloudCloudStorageService(config);
        }else if(config.getType() == Constant.CloudService.HUAWEI.getValue()){
            return new HuaweiCloudStorageService(config);
        }

        return null;
    }

}