Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SiEn
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
hewei
SiEn
Commits
4c51b2f9
Commit
4c51b2f9
authored
Nov 06, 2020
by
zhangjw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1:修复已知bug
parent
feb57d06
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
customer-service/src/main/java/com/ym/im/handler/HeartBeatServerHandler.java
+1
-2
customer-service/src/main/java/com/ym/im/service/impl/StaffServiceImpl.java
+8
-2
customer-service/src/main/resources/application-dev.yml
+5
-5
No files found.
customer-service/src/main/java/com/ym/im/handler/HeartBeatServerHandler.java
View file @
4c51b2f9
...
@@ -27,8 +27,7 @@ public class HeartBeatServerHandler extends BaseHandler<HeartBeat> {
...
@@ -27,8 +27,7 @@ public class HeartBeatServerHandler extends BaseHandler<HeartBeat> {
IdleStateEvent
event
=
(
IdleStateEvent
)
evt
;
IdleStateEvent
event
=
(
IdleStateEvent
)
evt
;
if
(
event
.
state
()
==
IdleState
.
READER_IDLE
)
{
if
(
event
.
state
()
==
IdleState
.
READER_IDLE
)
{
ctx
.
channel
().
close
();
ctx
.
channel
().
close
();
final
Long
userId
=
ctx
.
channel
().
attr
(
ChannelAttributeKey
.
ROLE_ID
).
get
();
log
.
info
(
"用户: "
+
ctx
.
channel
().
attr
(
ChannelAttributeKey
.
ROLE_ID
).
get
()
+
" 无心跳 "
);
log
.
info
(
"用户: "
+
userId
+
" 无心跳 "
);
}
}
}
else
{
}
else
{
super
.
userEventTriggered
(
ctx
,
evt
);
super
.
userEventTriggered
(
ctx
,
evt
);
...
...
customer-service/src/main/java/com/ym/im/service/impl/StaffServiceImpl.java
View file @
4c51b2f9
...
@@ -10,7 +10,10 @@ import com.ym.im.service.StaffService;
...
@@ -10,7 +10,10 @@ import com.ym.im.service.StaffService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
static
java
.
util
.
Map
.
Entry
.
comparingByValue
;
import
static
java
.
util
.
Map
.
Entry
.
comparingByValue
;
import
static
java
.
util
.
stream
.
Collectors
.
toMap
;
import
static
java
.
util
.
stream
.
Collectors
.
toMap
;
...
@@ -72,7 +75,10 @@ public class StaffServiceImpl implements StaffService {
...
@@ -72,7 +75,10 @@ public class StaffServiceImpl implements StaffService {
return
new
MsgBody
<>().
setCode
(
MsgBody
.
BINDINGFAILURE
).
setMessage
(
ResultStatus
.
FORWARD_FAILURE
.
getMessage
());
return
new
MsgBody
<>().
setCode
(
MsgBody
.
BINDINGFAILURE
).
setMessage
(
ResultStatus
.
FORWARD_FAILURE
.
getMessage
());
}
}
//移除原客服绑定
//移除原客服绑定
channelGroup
.
getMerchantStaff
(
userSocketInfo
.
getStaffId
(
merchantId
)).
getUserIds
().
remove
(
userId
);
final
StaffSocketInfo
merchantStaff
=
channelGroup
.
getMerchantStaff
(
userSocketInfo
.
getStaffId
(
merchantId
));
if
(
merchantStaff
!=
null
)
{
merchantStaff
.
getUserIds
().
remove
(
userId
);
}
//设置新的客服
//设置新的客服
staffSocketInfo
.
getUserIds
().
add
(
userId
);
staffSocketInfo
.
getUserIds
().
add
(
userId
);
userSocketInfo
.
setStaff
(
merchantId
,
staffId
);
userSocketInfo
.
setStaff
(
merchantId
,
staffId
);
...
...
customer-service/src/main/resources/application-dev.yml
View file @
4c51b2f9
...
@@ -16,9 +16,9 @@ spring:
...
@@ -16,9 +16,9 @@ spring:
max-wait
:
60000
max-wait
:
60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位毫秒
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位毫秒
time-between-eviction-runs-millis
:
60000
time-between-eviction-runs-millis
:
60000
url
:
jdbc:mysql://
127.0.0.1
/customer_service?useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
url
:
jdbc:mysql://
47.99.47.225
/customer_service?useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
username
:
root
username
:
root
password
:
101020
password
:
temple123456
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
connectionInitSqls
:
set names utf8mb4
connectionInitSqls
:
set names utf8mb4
jackson
:
jackson
:
...
@@ -28,9 +28,9 @@ spring:
...
@@ -28,9 +28,9 @@ spring:
port
:
5672
port
:
5672
username
:
root
username
:
root
password
:
root
password
:
root
staff-offline-Queue-Name
:
staff.offline
.dev
staff-offline-Queue-Name
:
staff.offline
order-queue-name
:
push.order
.dev
order-queue-name
:
push.order
exchange-name
:
delay.exchange
.dev
exchange-name
:
delay.exchange
listener
:
listener
:
simple
:
simple
:
default-requeue-rejected
:
false
default-requeue-rejected
:
false
...
...
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