package com.yida.data.user.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.user.EduFaceGroupStrategy;
import com.yida.data.user.feign.RemoteFaceGroupStrategyService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

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

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

        return new RemoteFaceGroupStrategyService() {
            @Override
            public ResultBean<EduFaceGroupStrategy> getStrategyInfo(Long faceGroupId) {
                return null;
            }
        };
    }
}
