Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-communication
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-communication
Commits
3d633364
Commit
3d633364
authored
Aug 11, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
0ca9a488
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
yd-communication-api/src/main/java/com/yd/communication/api/service/impl/ApiCoSessionServiceImpl.java
+6
-6
No files found.
yd-communication-api/src/main/java/com/yd/communication/api/service/impl/ApiCoSessionServiceImpl.java
View file @
3d633364
...
@@ -422,11 +422,11 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
...
@@ -422,11 +422,11 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
log
.
info
(
"【加入会话-内部】数据库更新成功,新状态={}"
,
session
.
getStatus
());
log
.
info
(
"【加入会话-内部】数据库更新成功,新状态={}"
,
session
.
getStatus
());
// 更新 Redis 缓存
// 更新 Redis 缓存
RoomRedisInfoDTO
roomRedisInfoDTO
=
redisUtil
.
getCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
session
.
getRoomId
());
RoomRedisInfoDTO
roomRedisInfoDTO
=
redisUtil
.
getCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
session
.
getRoomId
()
+
":"
+
session
.
getRoomPwd
()
);
if
(
roomRedisInfoDTO
!=
null
)
{
if
(
roomRedisInfoDTO
!=
null
)
{
roomRedisInfoDTO
.
setControlHolderType
(
session
.
getControlHolderType
());
roomRedisInfoDTO
.
setControlHolderType
(
session
.
getControlHolderType
());
roomRedisInfoDTO
.
setControlHolderId
(
session
.
getControlHolderId
());
roomRedisInfoDTO
.
setControlHolderId
(
session
.
getControlHolderId
());
redisUtil
.
setCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
session
.
getRoomId
(),
roomRedisInfoDTO
,
redisUtil
.
setCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
session
.
getRoomId
()
+
":"
+
session
.
getRoomPwd
()
,
roomRedisInfoDTO
,
RedisEnum
.
ROOM
.
getTimeout
(),
RedisEnum
.
ROOM
.
getTimeUnit
());
RedisEnum
.
ROOM
.
getTimeout
(),
RedisEnum
.
ROOM
.
getTimeUnit
());
log
.
info
(
"【加入会话-内部】Redis缓存更新成功,新控制者={}:{}"
,
log
.
info
(
"【加入会话-内部】Redis缓存更新成功,新控制者={}:{}"
,
session
.
getControlHolderType
(),
session
.
getControlHolderId
());
session
.
getControlHolderType
(),
session
.
getControlHolderId
());
...
@@ -524,7 +524,7 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
...
@@ -524,7 +524,7 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
log
.
info
(
"【结束会话】数据库更新成功,状态已结束"
);
log
.
info
(
"【结束会话】数据库更新成功,状态已结束"
);
// 销毁redis房间缓存信息
// 销毁redis房间缓存信息
redisUtil
.
deleteObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
coSession
.
getRoomId
());
redisUtil
.
deleteObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
coSession
.
getRoomId
()
+
":"
+
coSession
.
getRoomPwd
()
);
log
.
info
(
"【结束会话】Redis缓存已删除"
);
log
.
info
(
"【结束会话】Redis缓存已删除"
);
// 添加操作日志,协同-操作日志表
// 添加操作日志,协同-操作日志表
...
@@ -606,11 +606,11 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
...
@@ -606,11 +606,11 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
session
.
getControlHolderType
(),
session
.
getControlHolderId
());
session
.
getControlHolderType
(),
session
.
getControlHolderId
());
// 更新房间缓存redis信息
// 更新房间缓存redis信息
RoomRedisInfoDTO
roomRedisInfoDTO
=
redisUtil
.
getCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
roomId
);
RoomRedisInfoDTO
roomRedisInfoDTO
=
redisUtil
.
getCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
roomId
+
":"
+
session
.
getRoomPwd
()
);
if
(
roomRedisInfoDTO
!=
null
)
{
if
(
roomRedisInfoDTO
!=
null
)
{
roomRedisInfoDTO
.
setControlHolderId
(
session
.
getControlHolderId
());
roomRedisInfoDTO
.
setControlHolderId
(
session
.
getControlHolderId
());
roomRedisInfoDTO
.
setControlHolderType
(
session
.
getControlHolderType
());
roomRedisInfoDTO
.
setControlHolderType
(
session
.
getControlHolderType
());
redisUtil
.
setCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
roomId
,
roomRedisInfoDTO
,
redisUtil
.
setCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
roomId
+
":"
+
session
.
getRoomPwd
()
,
roomRedisInfoDTO
,
RedisEnum
.
ROOM
.
getTimeout
(),
RedisEnum
.
ROOM
.
getTimeUnit
());
RedisEnum
.
ROOM
.
getTimeout
(),
RedisEnum
.
ROOM
.
getTimeUnit
());
log
.
info
(
"【切换控制权-内部】Redis缓存更新成功"
);
log
.
info
(
"【切换控制权-内部】Redis缓存更新成功"
);
}
else
{
}
else
{
...
@@ -657,7 +657,7 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
...
@@ -657,7 +657,7 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
roomRedisInfoDTO
.
setControlHolderType
(
session
.
getControlHolderType
());
roomRedisInfoDTO
.
setControlHolderType
(
session
.
getControlHolderType
());
roomRedisInfoDTO
.
setControlHolderId
(
session
.
getControlHolderId
());
roomRedisInfoDTO
.
setControlHolderId
(
session
.
getControlHolderId
());
// 查询出来的信息更新回缓存里面
// 查询出来的信息更新回缓存里面
redisUtil
.
setCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
roomId
,
roomRedisInfoDTO
,
redisUtil
.
setCacheObject
(
RedisEnum
.
ROOM
.
getPrefix
()
+
roomId
+
":"
+
session
.
getRoomPwd
()
,
roomRedisInfoDTO
,
RedisEnum
.
ROOM
.
getTimeout
(),
RedisEnum
.
ROOM
.
getTimeUnit
());
RedisEnum
.
ROOM
.
getTimeout
(),
RedisEnum
.
ROOM
.
getTimeUnit
());
log
.
info
(
"【获取当前控制者】从数据库加载并更新缓存,控制者={}:{}"
,
log
.
info
(
"【获取当前控制者】从数据库加载并更新缓存,控制者={}:{}"
,
session
.
getControlHolderType
(),
session
.
getControlHolderId
());
session
.
getControlHolderType
(),
session
.
getControlHolderId
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment