package com.xhpc.common.api.factory;

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

/**
 * @author yuyang
 * @date 2022/3/17 15:04
 */
@Component
public class TenantFallbackFactory implements FallbackFactory<TenantService> {
    @Override
    public TenantService create(Throwable cause) {
        return new TenantService() {
            @Override
            public R gettenantIdTime(String tenantId) {
                return R.fail(3886,"租户服务发送失败:" + cause.getMessage());
            }


            @Override
            public R getTenantDetail(String tenantId) {
                return R.fail(3886,"租户服务发送失败:" + cause.getMessage());
            }
        };
    }
}
