package com.xhpc.common.api.factory;

import com.xhpc.common.api.CardService;
import com.xhpc.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author yuyang
 * @date 2022/1/19 17:18
 */
@Component
public class CardFallbackFactory implements FallbackFactory<CardService> {

    @Override
    public CardService create(Throwable cause) {
        return new CardService() {
            @Override
            public R cardStartup(String cardno, String serialNumber,String rateModelId) {
                return R.fail(3886,"卡启动判断接口失败:" + cause.getMessage());
            }
        };
    }
}
