/**
 * ydd-fast
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.yiqi.oss.cloud;

import java.io.InputStream;

/**
 * 阿里云存储
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2017-03-26 16:22
 */

public class MinioLocalStorageService extends CloudStorageService {
    @Override
    public String upload(byte[] data, String path) {
        return null;
    }

    @Override
    public String uploadSuffix(byte[] data, String suffix) {
        return null;
    }

    @Override
    public String upload(InputStream inputStream, String path) {
        return null;
    }

    @Override
    public String uploadSuffix(InputStream inputStream, String suffix) {
        return null;
    }

    //    private MinioClient minioClient;

    public MinioLocalStorageService(CloudStorageConfig config) {
        this.config = config;
        //初始化
//        init();
    }
//
//    private void init() {
//        try {
//            minioClient = new MinioClient(config.getMinioEndpoint(), config.getMinioAccessKey(),
//                    config.getMinioSecretKey());
//        } catch (Exception e){
//            e.printStackTrace();
//        }
//    }
//
//    @Override
//    public String upload(byte[] data, String path) {
//        return upload(new ByteArrayInputStream(data), path);
//    }
//
//    @Override
//    public String upload(InputStream inputStream, String suffix) {
//        try {
//            String path = getPath(null, suffix);  //生成后缀
//            minioClient.putObject(config.getMinioBucketName(), path, inputStream, "application/octet-stream");
//            return config.getMinioDomain() + "/" +config.getMinioBucketName()+"/" + path;
//        } catch (Exception e) {
//            e.printStackTrace();
//            throw new ServiceException("失败，请检查配置信息", e);
//        }
//    }
//
//    @Override
//    public String uploadSuffix(byte[] data, String suffix) {
//        return upload(data, getPath(config.getAliyunPrefix(), suffix));
//    }
//
//    @Override
//    public String uploadSuffix(InputStream inputStream, String suffix) {
//        return upload(inputStream, getPath(config.getAliyunPrefix(), suffix));
//    }
}
