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.BaiduApiConfig;
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
import com.yida.data.system.feign.RemoteBaiDuApiConfigService;
import com.yida.data.system.feign.RemoteConstructionPayConfigService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteBaiDuApiConfigService fallback处理类
 *
 * @author ZYJ
 * @date 2023/6/20
 */
@Slf4j
@Fallback
public class RemoteBaiDuApiConfigServiceFallback implements FallbackFactory<RemoteBaiDuApiConfigService> {

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

        return new RemoteBaiDuApiConfigService() {
            @Override
            public ResultBean<BaiduApiConfig> getBaiDuApiConfigByDept(Long deptId, String moduleName) {
                return null;
            }
        };
    }
}
