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

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

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

        return new RemotePayWxConfigService() {
            @Override
            public ResultBean<EduPayWxConfig> getPayWxConfigBySchool(Long schoolId) {
                return null;
            }
        };
    }
}
