mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
适配eureka
This commit is contained in:
@@ -127,24 +127,20 @@ public class RouteApi {
|
|||||||
|
|
||||||
|
|
||||||
private void updateRouteConfig(RouteUpdateParam routeUpdateParam) {
|
private void updateRouteConfig(RouteUpdateParam routeUpdateParam) {
|
||||||
try {
|
String routeId = routeUpdateParam.getId();
|
||||||
String routeId = routeUpdateParam.getId();
|
ConfigRouteBase configRouteBase = configRouteBaseMapper.getByColumn("route_id", routeId);
|
||||||
ConfigRouteBase configRouteBase = configRouteBaseMapper.getByColumn("route_id", routeId);
|
boolean doSave = configRouteBase == null;
|
||||||
boolean doSave = configRouteBase == null;
|
if (doSave) {
|
||||||
if (doSave) {
|
configRouteBase = new ConfigRouteBase();
|
||||||
configRouteBase = new ConfigRouteBase();
|
configRouteBase.setRouteId(routeId);
|
||||||
configRouteBase.setRouteId(routeId);
|
}
|
||||||
}
|
configRouteBase.setStatus(routeUpdateParam.getStatus().byteValue());
|
||||||
configRouteBase.setStatus(routeUpdateParam.getStatus().byteValue());
|
|
||||||
|
|
||||||
int i = doSave ? configRouteBaseMapper.save(configRouteBase)
|
int i = doSave ? configRouteBaseMapper.save(configRouteBase)
|
||||||
: configRouteBaseMapper.update(configRouteBase);
|
: configRouteBaseMapper.update(configRouteBase);
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
this.sendMsg(configRouteBase);
|
this.sendMsg(configRouteBase);
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("发送msg失败", e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +174,6 @@ public class RouteApi {
|
|||||||
Collectors.mapping(PermRolePermission::getRoleCode, Collectors.toList())));
|
Collectors.mapping(PermRolePermission::getRoleCode, Collectors.toList())));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return permRolePermissionMapper.list(new Query().in("route_id", routeIdList))
|
return permRolePermissionMapper.list(new Query().in("route_id", routeIdList))
|
||||||
.stream()
|
.stream()
|
||||||
.map(permRolePermission -> {
|
.map(permRolePermission -> {
|
||||||
|
@@ -50,6 +50,7 @@ public class ConfigPushService {
|
|||||||
List<ServiceInstanceVO> serviceInstanceList = serverService.listService(serviceSearchParam);
|
List<ServiceInstanceVO> serviceInstanceList = serverService.listService(serviceSearchParam);
|
||||||
Collection<String> hostList = serviceInstanceList
|
Collection<String> hostList = serviceInstanceList
|
||||||
.stream()
|
.stream()
|
||||||
|
.filter(serviceInstanceVO -> StringUtils.isNotBlank(serviceInstanceVO.getInstanceId()))
|
||||||
.map(ServiceInstanceVO::getIpPort)
|
.map(ServiceInstanceVO::getIpPort)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
this.pushByHost(hostList, gatewayPushDTO);
|
this.pushByHost(hostList, gatewayPushDTO);
|
||||||
|
Reference in New Issue
Block a user