package com.zcloud.service.remote;

import com.zcloud.util.ReturnMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Arrays;
import java.util.Base64;

public class CorpFeignClientFallback implements RemoteCorpService{
    private static Logger logger = LoggerFactory.getLogger(CorpFeignClientFallback.class);

    private Throwable cause;
    public CorpFeignClientFallback(Throwable throwable) {
        this.cause = throwable;
    }

    // 默认回调，如需处理其他业务请方法内定义
    public Object defaultMethod() {
        logger.error("openFeign调用失败：" + Arrays.toString(cause.getStackTrace()));
//        throw cause;
        return ReturnMap.error(500, "调用失败");
    }
    @Override
    public Object getCorpInfo(String ParamsJson) {
        return defaultMethod();
    }

}
