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

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

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

        return new RemotePayTypeService() {
            @Override
            public ResultBean<EduDeptPayType> getPayTypeByDeptId(Long deptId) {
                return null;
            }
        };
    }
}
