package com.xhpc.common.api.factory;

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

/**
 * @author yuyang
 * @date 2022/1/24 17:51
 */
@Component
public class CardHistoryOrderFactory implements FallbackFactory<CardHistoryOrderService> {
    @Override
    public CardHistoryOrderService create(Throwable cause) {

        return new CardHistoryOrderService() {
            @Override
            public R cardStartup(Long userId,String serialNumber,Integer userType,String tenantId,Integer type,String grantOperator,String rateModelId) {
                return R.fail(3886,"服务回滚:" + cause.getMessage());
            }
        };
    }
}
