package com.yida.data.school.fallback.visitor;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.school.feign.visitor.RemoteVisitorService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteVisitorService fallback处理类
 *
 * @author ZYJ
 * @date 2022/8/26
 */
@Slf4j
@Fallback
public class RemoteVisitorServiceFallback implements FallbackFactory<RemoteVisitorService> {

    @Override
    public RemoteVisitorService create(Throwable throwable) {
        log.error("RemoteVisitorService fallback reason:{}", throwable.getMessage());

        return new RemoteVisitorService() {
            @Override
            public ResultBean dealRequestDdl() {
                return null;
            }
        };
    }
}
