MCPcopy Create free account
hub / github.com/Hello-hao/Tbed / GetSource

Class GetSource

src/main/java/cn/hellohao/utils/GetSource.java:17–69  ·  view source on GitHub ↗

@author Hellohao @version 1.0 @date 2019/11/7 17:12

Source from the content-addressed store, hash-verified

15 * @date 2019/11/7 17:12
16 */
17@Service
18public class GetSource {
19
20 @Autowired
21 NOSImageupload nosImageupload;
22 @Autowired
23 OSSImageupload ossImageupload;
24 @Autowired
25 USSImageupload ussImageupload;
26 @Autowired
27 KODOImageupload kodoImageupload;
28 @Autowired
29 COSImageupload cosImageupload;
30 @Autowired
31 FtpServiceImpl ftpService;
32 @Autowired
33 S3Imageupload s3Imageupload;
34 @Autowired
35 WebDAVImageupload webDAVImageupload;
36 public ReturnImage storageSource(Integer type, Map<Map<String, String>, File> fileMap, String userpath,Integer keyID){
37 ReturnImage returnImage = null;
38 try {
39 if(type==1){
40 returnImage = nosImageupload.Imageupload(fileMap, userpath,keyID);
41 }else if (type==2){
42 returnImage = ossImageupload.ImageuploadOSS(fileMap, userpath,keyID);
43 }else if(type==3 ){
44 returnImage = ussImageupload.ImageuploadUSS(fileMap, userpath,keyID);
45 }else if(type==4){
46 returnImage = kodoImageupload.ImageuploadKODO(fileMap, userpath,keyID);
47 }else if(type==5){
48 returnImage = LocUpdateImg.ImageuploadLOC(fileMap, userpath,keyID);
49 }else if(type==6){
50 returnImage = cosImageupload.ImageuploadCOS(fileMap, userpath,keyID);;
51 }else if(type==7){
52 returnImage = ftpService.FtpUploadFile(fileMap, userpath,keyID);
53 }else if(type==8){
54 returnImage = s3Imageupload.ImageuploadS3(fileMap, userpath,keyID);
55 }else if(type==9){
56 returnImage = webDAVImageupload.ImageuploadWebDAV(fileMap, userpath,keyID);
57 }
58 else{
59 new StorageSourceInitException("GetSource类捕捉异常:未找到存储源");
60 }
61 } catch (Exception e) {
62 new StorageSourceInitException("GetSource类捕捉异常:",e);
63 e.printStackTrace();
64 }
65 return returnImage;
66 }
67
68
69}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected