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

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

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

        return new RemoteUnionPayConfigService() {
            @Override
            public ResultBean<UnionPayConfig> getUnionPayConfigByDept(Long deptId) {
                return null;
            }
        };
    }
}
