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.consume.EduConsumeConfig;
import com.yida.data.system.feign.RemoteConsumeConfigService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteConsumeConfigService fallback处理类
 *
 * @author ZYJ
 * @date 2023/4/6
 */
@Slf4j
@Fallback
public class RemoteConsumeConfigServiceFallback implements FallbackFactory<RemoteConsumeConfigService> {

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

        return new RemoteConsumeConfigService() {
            @Override
            public ResultBean<EduConsumeConfig> getConsumeConfigByDept(Long deptId) {
                return null;
            }
        };
    }
}
