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

/**
 * RemoteUPayConfigService fallback处理类
 *
 * @author ZYJ
 * @date 2023/3/21
 */
@Slf4j
@Fallback
public class RemoteUPayConfigServiceFallback implements FallbackFactory<RemoteUPayConfigService> {

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

        return new RemoteUPayConfigService() {
            @Override
            public ResultBean<UPayConfig> getUPayConfigByDept(Long deptId) {
                return null;
            }
        };
    }
}
