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

/**
 * RemoteConstructionPayConfigService fallback处理类
 *
 * @author ZYJ
 * @date 2023/6/19
 */
@Slf4j
@Fallback
public class RemoteConstructionPayConfigServiceFallback implements FallbackFactory<RemoteConstructionPayConfigService> {

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

        return new RemoteConstructionPayConfigService() {
            @Override
            public ResultBean<ConstructionPayConfig> getConstructionPayConfigByDept(Long deptId) {
                return null;
            }
        };
    }
}
