pull/1/head
tanghc 5 years ago
parent afe3ae59e4
commit 4827ff3a99
  1. 2
      README.md
  2. 4
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreLimitFilter.java

@ -26,7 +26,7 @@ SOP封装了开放平台大部分功能包括:签名验证、统一异常处
![架构图](https://images.gitee.com/uploads/images/2019/0821/201531_0f605f7c_332975.png "sop2.png") ![架构图](https://images.gitee.com/uploads/images/2019/0821/201531_0f605f7c_332975.png "sop2.png")
> 开发者只需写微服务部分的业务代码 > 如上图所示,整个系统运行后,开发者只需关注微服务中的业务代码,接口变更后重新部署微服务应用即可
## 已完成列表 ## 已完成列表

@ -59,7 +59,7 @@ public class PreLimitFilter extends BaseZuulFilter {
if (configLimitDto.getLimitStatus() == ConfigLimitDto.LIMIT_STATUS_CLOSE) { if (configLimitDto.getLimitStatus() == ConfigLimitDto.LIMIT_STATUS_CLOSE) {
return null; return null;
} }
byte limitType = configLimitDto.getLimitType().byteValue(); byte limitType = configLimitDto.getLimitType();
// 如果是漏桶策略 // 如果是漏桶策略
if (limitType == LimitType.LEAKY_BUCKET.getType()) { if (limitType == LimitType.LEAKY_BUCKET.getType()) {
boolean acquire = limitManager.acquire(configLimitDto); boolean acquire = limitManager.acquire(configLimitDto);
@ -109,7 +109,7 @@ public class PreLimitFilter extends BaseZuulFilter {
if (limitConfigList.isEmpty()) { if (limitConfigList.isEmpty()) {
return null; return null;
} }
Collections.sort(limitConfigList, Comparator.comparing(ConfigLimitDto::getOrderIndex)); limitConfigList.sort(Comparator.comparing(ConfigLimitDto::getOrderIndex));
return limitConfigList.get(0); return limitConfigList.get(0);
} }
} }

Loading…
Cancel
Save