StationManageFallBackFactory.java
809 字节
package com.sy.service.feigin;
import com.sy.response.ResultJson;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author mrz
*/
@Component
@Slf4j
public class StationManageFallBackFactory implements FallbackFactory<StationManageFeignService> {
@Override
public StationManageFeignService create(Throwable throwable) {
log.error("调用场站管理接口异常",throwable);
return new StationManageFeignService() {
@Override
public ResultJson getChanels(String channel, int pageNum, int pageSize) {
return new ResultJson("410","场站管理服务接口访问失败");
}
};
}
}