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

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.PageBean;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.permissions.api.dto.RoleDto;
import com.sptg.permissions.api.entity.Role;
import com.sptg.permissions.api.entity.WeiXinConf;
import com.sptg.permissions.api.feigns.RoleFeign;
import com.sptg.permissions.api.feigns.WeiXinConfFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * title: RoleFeignFallbackFactory
 * package: com.sptg.permissions.api.feigns.fallback
 * description: 微信配置参数对外服务接口容错处理
 *
 *
 *
 */
@Component
@Slf4j
public class WeiXinConfFeignFallbackFactory implements FallbackFactory<WeiXinConfFeign> {

    @Override
    public WeiXinConfFeign create(Throwable cause) {
        return new WeiXinConfFeign(){

            @Override
            public WeiXinConf selectEntityByOrgIdAndName(WeiXinConf weiXinConf) {
                log.error(cause.getMessage(), cause);
                return null;
            }
        };
    }
}
