package com.sptg.permissions.api.feigns.fallback;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.permissions.api.dto.AccountDto;
import com.sptg.permissions.api.dto.LoginDto;
import com.sptg.permissions.api.entity.Account;
import com.sptg.permissions.api.feigns.ThirdAuthenticationFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import me.zhyd.oauth.model.AuthCallback;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;

/**
 * title: ThirdAuthenticationFeignFallbackFactory
 * package: com.sptg.permissions.api.feigns.fallback
 * description: 认证授权相关接口-容错处理
 *
 *                  
 *                 
 */
@Component
@Slf4j
public class ThirdAuthenticationFeignFallbackFactory implements FallbackFactory<ThirdAuthenticationFeign> {

    @Override
    public ThirdAuthenticationFeign create(Throwable cause){
        return new ThirdAuthenticationFeign() {
            @Override
            public void renderAuth(String source, HttpServletResponse response) throws IOException {

            }

            @Override
            public ModelAndView login(String source, AuthCallback callback, HttpServletRequest request) {
                return null;
            }

        };
    }
}
