mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-29 16:06:36 +08:00
修复流量统计
This commit is contained in:
@@ -12,9 +12,6 @@ public class UserUpdateDto {
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
private String user;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.admin.common.task;
|
||||
|
||||
import com.admin.common.dto.ConfigItem;
|
||||
import com.admin.common.dto.GostConfigDto;
|
||||
import com.admin.common.dto.GostDto;
|
||||
import com.admin.common.utils.GostUtil;
|
||||
import com.admin.entity.Forward;
|
||||
import com.admin.entity.Node;
|
||||
@@ -74,7 +75,8 @@ public class CheckGostConfigAsync {
|
||||
Forward forward = forwardService.getById(forwardId);
|
||||
if (forward == null) {
|
||||
log.warn("删除孤立的服务: {} (节点: {})", service.getName(), node.getId());
|
||||
GostUtil.DeleteService(node.getId(), forwardId+"_"+userId+"_"+userTunnelId);
|
||||
GostDto gostDto = GostUtil.DeleteService(node.getId(), forwardId + "_" + userId + "_" + userTunnelId);
|
||||
System.out.println(gostDto);
|
||||
}
|
||||
}
|
||||
if (Objects.equals(type, "tls")) {
|
||||
|
||||
@@ -30,9 +30,6 @@ public class WebSocketServer extends TextWebSocketHandler {
|
||||
@Resource
|
||||
NodeService nodeService;
|
||||
|
||||
@Resource
|
||||
CheckGostConfigAsync checkGostConfigAsync;
|
||||
|
||||
// 存储所有活跃的 WebSocket 连接(
|
||||
private static final CopyOnWriteArraySet<WebSocketSession> activeSessions = new CopyOnWriteArraySet<>();
|
||||
|
||||
@@ -57,13 +54,7 @@ public class WebSocketServer extends TextWebSocketHandler {
|
||||
if (message.getPayload().contains("memory_usage")){
|
||||
// 先发送确认消息
|
||||
sendToUser(session, "{\"type\":\"call\"}");
|
||||
} else if (message.getPayload().contains("config_report")) {
|
||||
log.info("收到消息: {}", message.getPayload());
|
||||
JSONObject jsonObject = JSONObject.parseObject(message.getPayload());
|
||||
String string = jsonObject.getString("data");
|
||||
GostConfigDto gostConfigDto = JSONObject.parseObject(string, GostConfigDto.class);
|
||||
checkGostConfigAsync.cleanNodeConfigs(id, gostConfigDto);
|
||||
} else if (message.getPayload().contains("requestId")) {
|
||||
}else if (message.getPayload().contains("requestId")) {
|
||||
log.info("收到消息: {}", message.getPayload());
|
||||
// 处理命令响应消息
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user