package com.yida.data.user.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.user.EduStudentApply;
import com.yida.data.user.feign.RemoteStudentApplyService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;
import java.util.Map;

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

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

        return new RemoteStudentApplyService() {
            @Override
            public ResultBean<Map<Long, List<String>>> listApplyCode(Long[] studentIds) {
                return null;
            }

            @Override
            public ResultBean<Boolean> hasApply(Long studentId, String applyCode) {
                return null;
            }

            @Override
            public ResultBean<EduStudentApply> getStudentApply(Long studentId, String applyCode) {
                return null;
            }
        };
    }
}
