package com.yida.data.system.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.system.EduBaseApp;
import com.yida.data.system.feign.RemoteBaseAppService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Fallback
public class RemoteBaseAppServiceFallback implements FallbackFactory<RemoteBaseAppService> {

    @Override
    public RemoteBaseAppService create(Throwable throwable) {
        log.error("RemoteBaseAppService fallback reason:{}", throwable.getMessage());
        return new RemoteBaseAppService() {
            @Override
            public ResultBean<EduBaseApp> getById(Long id) {
                return null;
            }
        };
    }
}
