forked from kidgrow-microservices-platform

luliqiang
2020-08-14 ecea8849ad29ccc204d4994f6eeef5cd5064d0cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.kidgrow.filecenter.feign.fallback;
 
 
import com.kidgrow.common.model.ResultBody;
import com.kidgrow.filecenter.feign.FileService;
import com.kidgrow.filecenter.model.FileInfo;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
 
import java.util.Map;
 
/**
 * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
 *
 * @Description: <br>
 * @Project: <br>
 * @CreateDate: Created in 2020/2/22 14:33 <br>
 * @Author: <a href="4345453@kidgrow.com">liuke</a>
 */
@Slf4j
@Component
public class FileServiceFallbackFactory implements FallbackFactory<FileService> {
 
    @Override
    public FileService create(Throwable throwable) {
        return  new FileService() {
            @Override
            public FileInfo upload(@RequestParam("file") MultipartFile file) {
                return null;
            }
            @Override
            public FileInfo feignUpload(@RequestPart("file") MultipartFile file,@RequestParam String imgType) {
                return null;
            }
 
            @Override
            public FileInfo baseUplaod(String file, String imgType, String hospitalId, String departmentId) {
                return null;
            }
 
            @Override
            public ResultBody baseDownLoad(Map<String, Object> map) throws Exception {
                return null;
            }
        };
    }
}