【增加群组会话service】

This commit is contained in:
weizhihong 2023-04-14 16:45:01 +08:00
parent 0d1f5bf56b
commit 661c682d85
4 changed files with 52 additions and 12 deletions

View File

@ -2,6 +2,7 @@ package club.joylink.rtss.controller.simulation;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.simulation.cbtc.conversation.CommunicationObject;
import club.joylink.rtss.simulation.cbtc.conversation.ConversationGroupManagerService;
import club.joylink.rtss.simulation.cbtc.conversation.ConversationManagerService;
import club.joylink.rtss.simulation.cbtc.conversation.ConversationText;
import club.joylink.rtss.simulation.cbtc.data.vo.ConversationGroupVO;
@ -23,6 +24,9 @@ public class SimulationConversationController {
@Autowired
private ConversationManagerService conversationManagerService;
@Autowired
private ConversationGroupManagerService conversationGroupManagerService;
/**
*根据会话id获取仿真会话
*/
@ -109,6 +113,6 @@ public class SimulationConversationController {
*/
@GetMapping("/group/list")
public List<ConversationGroupVO> groupList(@PathVariable String group) {
return conversationManagerService.getAllConversationsGroup(group);
return conversationGroupManagerService.getAllConversationsGroup(group);
}
}

View File

@ -0,0 +1,30 @@
package club.joylink.rtss.simulation.cbtc.conversation;
import club.joylink.rtss.simulation.cbtc.GroupSimulationCache;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.vo.ConversationGroupVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Slf4j
@Service
public class ConversationGroupManagerService {
@Autowired
private GroupSimulationCache groupSimulationCache;
/**
* 获取所有群组信息
* @param group
* @return
*/
public List<ConversationGroupVO> getAllConversationsGroup(String group) {
Simulation simulation = groupSimulationCache.getSimulationByGroup(group);
List<ConversationGroup> allGroup = simulation.queryAllConversationGroup();
return ConversationGroupVO.convert2VOList(allGroup);
}
}

View File

@ -0,0 +1,17 @@
package club.joylink.rtss.simulation.cbtc.conversation;
import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 群组会话操作
*/
@OperateHandler
@Slf4j
public class ConversationGroupOperateHandler {
@Autowired
private ConversationGroupManagerService conversationGroupManagerService;
}

View File

@ -449,15 +449,4 @@ public class ConversationManagerService {
return conversation;
}
/**
* 获取所有群组信息
* @param group
* @return
*/
public List<ConversationGroupVO> getAllConversationsGroup(String group) {
Simulation simulation = groupSimulationCache.getSimulationByGroup(group);
List<ConversationGroup> allGroup = simulation.queryAllConversationGroup();
return ConversationGroupVO.convert2VOList(allGroup);
}
}