| | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * Account-side replacement for the common Sentinel Feign fallback. |
| | | * 账户服务对公共 Sentinel Feign 降级处理的替代实现。 |
| | | * |
| | | * <p>The dependency implementation casts {@link Method#getGenericReturnType()} |
| | | * directly to {@link Class}. That fails for generic Feign methods such as |
| | | * {@code List<IntegralCommodity>}; resolve the raw type first so a proper |
| | | * empty fallback value can be returned.</p> |
| | | * <p>依赖中的实现会将 {@link Method#getGenericReturnType()} 直接转换为 |
| | | * {@link Class}。对于 {@code List<IntegralCommodity>} 等泛型 Feign 方法会转换失败; |
| | | * 此处先解析原始类型,以便返回正确的空降级值。</p> |
| | | */ |
| | | public class DefaultFeignFallback<T> implements MethodInterceptor { |
| | | private static final Logger log = LoggerFactory.getLogger(DefaultFeignFallback.class); |