@Override public Boolean skip(final ServerWebExchange exchange) { final RequestDTO body = exchange.getAttribute(Constants.REQUESTDTO); return Objects.equals(Objects.requireNonNull(body).getRpcType(), RpcTypeEnum.DUBBO.getName()); }
/** * plugin is execute. * * @param exchange the current server exchange * @return default false. */ @Override public Boolean skip(final ServerWebExchange exchange) { final RequestDTO body = exchange.getAttribute(Constants.REQUESTDTO); return !Objects.equals(Objects.requireNonNull(body).getRpcType(), RpcTypeEnum.SPRING_CLOUD.getName()); } }
/** * plugin is execute. * * @return default false. */ @Override public Boolean skip(final ServerWebExchange exchange) { final RequestDTO body = exchange.getAttribute(Constants.REQUESTDTO); return !Objects.equals(Objects.requireNonNull(body).getRpcType(), RpcTypeEnum.HTTP.getName()); }
/** * plugin is execute. * * @param exchange the current server exchange * @return default false. */ @Override public Boolean skip(final ServerWebExchange exchange) { final RequestDTO body = exchange.getAttribute(Constants.REQUESTDTO); assert body != null; return !Objects.equals(body.getRpcType(), RpcTypeEnum.DUBBO.getName()); }
private Boolean verify(final RequestDTO requestDTO, final ServerWebExchange exchange) { if (Objects.isNull(requestDTO) || StringUtils.isBlank(requestDTO.getModule()) || StringUtils.isBlank(requestDTO.getMethod())) { return false; } final RpcTypeEnum rpcTypeEnum = RpcTypeEnum.acquireByName(requestDTO.getRpcType()); if (Objects.isNull(rpcTypeEnum)) { return false; } //if rpcType is dubbo if (Objects.equals(rpcTypeEnum.getName(), RpcTypeEnum.DUBBO.getName())) { final String dubboParams = requestDTO.getDubboParams(); if (StringUtils.isBlank(dubboParams)) { return false; } final Map<String, Object> paramMap = GSONUtils.getInstance().toObjectMap(dubboParams); if (paramMap.containsKey(DubboParamConstants.INTERFACE_NAME) && paramMap.containsKey(DubboParamConstants.METHOD)) { exchange.getAttributes().put(Constants.DUBBO_PARAMS, paramMap); return true; } else { return false; } } else { return !StringUtils.isBlank(requestDTO.getHttpMethod()) && !Objects.isNull(HttpMethodEnum.acquireByName(requestDTO.getHttpMethod())); } }
.map(rpcTypeEnum -> new EnumVO(null, rpcTypeEnum.getName(), rpcTypeEnum.getSupport())) .collect(Collectors.toList());
if (requestDTO.getRpcType().equals(RpcTypeEnum.DUBBO.getName())) {