package com.yida.data.auth;

import com.yida.data.common.core.annotation.Fallback;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteAuthService fallback处理类
 *
 * @author ZYJ
 * @date 2022/8/26
 */
@Slf4j
@Fallback
public class RemoteAuthServiceFallback implements FallbackFactory<RemoteAuthService> {

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

        return new RemoteAuthService() {
            /**
             * 撤销认证
             *
             * @param userName
             * @param clientId
             */
            @Override
            public void revokeApproval(String userName, String clientId) {

            }
        };
    }
}
