package com.yida.data.device.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.consume.EduStudentConsumeCard;
import com.yida.data.device.feign.consume.RemoteConsumeCardService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteConsumeCardService fallback处理类
 *
 * @author ZYJ
 * @date 2023/3/20
 */
@Slf4j
@Fallback
public class RemoteConsumeCardServiceFallback implements FallbackFactory<RemoteConsumeCardService> {

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

        return new RemoteConsumeCardService() {

            @Override
            public ResultBean<String> saveConsumeCard(EduStudentConsumeCard eduStudentConsumeCard) {
                return null;
            }
        };
    }
}
