forked from kidgrow-microservices-platform

luliqiang
2020-06-11 4dd862607e527036f08bf27615ba0adc2bd86c9b
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
package com.kidgrow.filecenter.feign.fallback;
 
 
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.multipart.MultipartFile;
 
/**
 * 石家庄喜高科技有限责任公司 版权所有 © 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;
            }
 
        };
    }
}