package com.yida.data.school.fallback.schoolConfig;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.school.EduSchoolFunctionConfig;
import com.yida.data.school.feign.schoolConfig.RemoteEduSchoolFuncationConfigService;
import feign.hystrix.FallbackFactory;
import java.util.List;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteEduSchoolFuncationConfigService fallback处理类
 */
@Slf4j
@Fallback
public class RemoteEduSchoolFuncationConfigServiceFallback implements FallbackFactory<RemoteEduSchoolFuncationConfigService> {

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

        return new RemoteEduSchoolFuncationConfigService() {

            @Override
            public ResultBean<List<EduSchoolFunctionConfig>> getSchoolFunctionConfigListByCondition() {
                return null;
            }

            @Override
            public ResultBean<Boolean> checkSchoolFunctionCode(Long schoolId, String code) {
                return null;
            }


        };
    }
}
