package com.sw.mes.utils;//package com.sw.mes.utils;
//
//import com.github.tobato.fastdfs.domain.fdfs.StorePath;
//import com.github.tobato.fastdfs.domain.fdfs.ThumbImageConfig;
//import com.github.tobato.fastdfs.service.FastFileStorageClient;
//import org.apache.commons.io.FilenameUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//import org.springframework.web.multipart.MultipartFile;
//
//import java.io.IOException;
//import java.io.InputStream;
//
///**
// * @Author wudanjun
// * @Description：storageClient包装类
// * @Date: Create in 16:51 2018/5/4
// * @Modified By:
// */
//@Component
//public class FastDFSClientWrapper {
//    @Value("${fdfs.fsUrl}")
//    String fsUrl;
//
//    @Autowired
//    private FastFileStorageClient storageClient;
//
//    @Autowired
//    ThumbImageConfig thumbImageConfig;
//
//    public String uploadFile(MultipartFile file) throws IOException {
//        StorePath storePath = storageClient.uploadFile((InputStream) file.getInputStream(), file.getSize(), FilenameUtils.getExtension(file.getOriginalFilename()), null);
//        return fsUrl+storePath.getFullPath();
//    }
//
//    public ImageResponse uploadImageAndCrtThumbImage(MultipartFile file) throws IOException {
//        StorePath storePath = storageClient.uploadImageAndCrtThumbImage((InputStream) file.getInputStream(), file.getSize(), FilenameUtils.getExtension(file.getOriginalFilename()), null);
//        ImageResponse imageResponse=new ImageResponse();
//        imageResponse.setBigurl(storePath.getFullPath());
//        imageResponse.setThumburl(thumbImageConfig.getThumbImagePath(storePath.getFullPath()));
//        return imageResponse;
//    }
//}
//
