pull/1/head
tanghc 5 years ago
parent a50f73563a
commit 888d1e0c4e
  1. 8
      sop-gateway/src/main/java/com/gitee/sop/gateway/manager/DbRoutesProcessor.java
  2. 2
      sop-gateway/src/main/resources/application-dev.properties

@ -8,9 +8,9 @@ import com.gitee.sop.gatewaycommon.bean.InstanceDefinition;
import com.gitee.sop.gatewaycommon.bean.ServiceRouteInfo;
import com.gitee.sop.gatewaycommon.route.RoutesProcessor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
@ -62,7 +62,9 @@ public class DbRoutesProcessor implements RoutesProcessor {
// 删除serviceId下所有的路由
this.removeAllRoutes(serviceId);
// 批量保存
configServiceRouteMapper.saveBatch(configServiceRoutes);
if (CollectionUtils.isNotEmpty(configServiceRoutes)) {
// 批量保存
configServiceRouteMapper.saveBatch(configServiceRoutes);
}
}
}

@ -18,6 +18,8 @@ zipkin.url=http://127.0.0.1:9411/
pre.domain=localhost
# ------- 需要改的配置end -------
sop.restful.enable=true
# 入口地址,不用改,默认是/zuul
zuul.servlet-path=/api
# 禁用默认的过滤器,不能删,不用改

Loading…
Cancel
Save