mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2026-02-04 06:55:52 +08:00
[add] 客户端下线异常问题
This commit is contained in:
@@ -62,5 +62,10 @@ public class LazyNettyServerRouteQueryListCommand {
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
}
|
||||
@@ -62,5 +62,10 @@ public class LazyNettyServerRouteQueryOneCommand {
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
}
|
||||
@@ -62,5 +62,10 @@ public class LazyNettyServerRouteRemoveCommand {
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
}
|
||||
@@ -56,5 +56,10 @@ public class LazyNettyServerRouteStoryCommand {
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
}
|
||||
@@ -62,5 +62,10 @@ public class LazyNettyServerRouteUpdateCommand {
|
||||
*/
|
||||
@Schema(description ="更新时间",name ="updateTime",example = "")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
private String namespace;
|
||||
|
||||
}
|
||||
@@ -164,8 +164,6 @@ public class LazyNettyClientStateApplicationImpl implements LazyNettyClientState
|
||||
@Override
|
||||
public Result<List<LazyNettyClientStateGroupByClientDTO>> findListGroupByClient(LazyNettyClientStateQueryListCommand lazyNettyClientStateQueryListCommand) {
|
||||
LazyNettyClientState lazyNettyClientState = NettyClientStateDTOAssembler.INSTANCE.toNettyClientState(lazyNettyClientStateQueryListCommand);
|
||||
String serverId = serverNodeProperties.getNodeId();
|
||||
lazyNettyClientState.setNamespace(serverId);
|
||||
return lazyNettyClientStateRepository.findListGroupByClient(lazyNettyClientState).convert(nettyClientStates -> nettyClientStates.stream().map(NettyClientStateDTOAssembler.INSTANCE::fromNettyClientState).collect(Collectors.toList()));
|
||||
|
||||
}
|
||||
@@ -183,8 +181,6 @@ public class LazyNettyClientStateApplicationImpl implements LazyNettyClientState
|
||||
@Override
|
||||
public Result<LazyPage<LazyNettyClientStateGroupByClientDTO>> findPageGroupByClient(int size, int current, LazyNettyClientStateQueryListCommand lazyNettyClientStateQueryListCommand) {
|
||||
LazyNettyClientState lazyNettyClientState = NettyClientStateDTOAssembler.INSTANCE.toNettyClientState(lazyNettyClientStateQueryListCommand);
|
||||
String serverId = serverNodeProperties.getNodeId();
|
||||
lazyNettyClientState.setNamespace(serverId);
|
||||
return lazyNettyClientStateRepository.findPageGroupByClient(size, current, lazyNettyClientState).convert(page -> page.convert(NettyClientStateDTOAssembler.INSTANCE::fromNettyClientState));
|
||||
}
|
||||
|
||||
@@ -200,12 +196,11 @@ public class LazyNettyClientStateApplicationImpl implements LazyNettyClientState
|
||||
@Override
|
||||
public Result<LazyNettyClientState> remove(LazyNettyClientStateRemoveCommand lazyNettyClientStateRemoveCommand) {
|
||||
LazyNettyClientState lazyNettyClientState = NettyClientStateDTOAssembler.INSTANCE.toNettyClientState(lazyNettyClientStateRemoveCommand);
|
||||
String serverId = serverNodeProperties.getNodeId();
|
||||
lazyNettyClientState.setNamespace(serverId);
|
||||
// 获取当前客户端通道 而后关闭
|
||||
String clientId = lazyNettyClientStateRemoveCommand.getClientId();
|
||||
String namespace = lazyNettyClientStateRemoveCommand.getNamespace();
|
||||
// 心跳关闭
|
||||
ChannelContext.clear(serverId, clientId);
|
||||
ChannelContext.clear(namespace, clientId);
|
||||
// 关闭访客
|
||||
List<NettyTcpServerPermeateClientVisitorSocket> nettyTcpServerPermeateClientVisitorSocketList = NettyClientVisitorContext.getVisitorSockets(clientId);
|
||||
if (!ObjectUtils.isEmpty(nettyTcpServerPermeateClientVisitorSocketList)) {
|
||||
|
||||
@@ -66,7 +66,7 @@ public class LazyNettyNamespaceDO {
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
@LazyTableField(name="namespace",comment="命名空间",columnType="varchar(255)")
|
||||
@LazyTableFieldUnique(name="namespace",comment="命名空间",columnType="varchar(25)")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,7 +82,7 @@ public class LazyNettyServerRouteDO {
|
||||
* 命名空间
|
||||
*/
|
||||
@Schema(description ="命名空间",name ="namespace",example = "")
|
||||
@LazyTableFieldUnique(name="namespace",comment="命名空间",columnType="varchar(25)",defaultValue = "DEFAULT")
|
||||
@LazyTableField(name="namespace",comment="命名空间",columnType="varchar(25)",defaultValue = "DEFAULT")
|
||||
private String namespace;
|
||||
|
||||
}
|
||||
@@ -53,6 +53,7 @@ public class LazyNettyServerRouteRepositoryImpl implements LazyNettyServerRout
|
||||
@Override
|
||||
public Result<LazyNettyServerRoute> story(LazyNettyServerRoute lazyNettyServerRoute) {
|
||||
LazyNettyServerRouteDO lazyNettyServerRouteDO = LazyNettyServerRouteConverter.INSTANCE.fromLazyNettyServerRoute(lazyNettyServerRoute);
|
||||
|
||||
lazyLambdaStream.upsert(lazyNettyServerRouteDO);
|
||||
String routeIp = lazyNettyServerRoute.getRouteIp();
|
||||
String routePort = NormalUsedString.ASTERISK;
|
||||
|
||||
Reference in New Issue
Block a user