Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
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
wecloud_im_server
Commits
8ff4dadd
Commit
8ff4dadd
authored
Aug 03, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口: 允许客户端修改是否单向隐藏会话
parent
68a1456a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
12 deletions
+13
-12
common/src/main/java/com/wecloud/im/controller/ImConversationController.java
+3
-3
common/src/main/java/com/wecloud/im/netty/core/WsReadHandler.java
+3
-3
common/src/main/java/com/wecloud/im/param/add/ImConversationDisplayUpdate.java
+2
-4
common/src/main/java/com/wecloud/im/service/ImConversationService.java
+1
-1
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+1
-1
common/src/main/java/com/wecloud/im/ws/strategy/concrete/ImConcreteReceiveStrategy.java
+3
-0
No files found.
common/src/main/java/com/wecloud/im/controller/ImConversationController.java
View file @
8ff4dadd
...
...
@@ -56,10 +56,10 @@ public class ImConversationController extends BaseController {
/**
* 修改是否单向隐藏会话
*/
@PostMapping
(
"/display"
)
@PostMapping
(
"/display
Update
"
)
@ApiOperation
(
value
=
"修改是否单向隐藏会话"
,
notes
=
"云端聊天记录不删除;假设有A和B两个用户,A删会话,B还能发; 如果B发了消息,A这边要重新把会话显示出来,并能显示之前的聊天记录"
)
public
ApiResult
<
Boolean
>
d
isplayConversation
(
@RequestBody
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
{
boolean
flag
=
imConversationService
.
d
isplayConversation
(
imConversationDisplayUpdate
);
public
ApiResult
<
Boolean
>
updateD
isplayConversation
(
@RequestBody
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
{
boolean
flag
=
imConversationService
.
updateD
isplayConversation
(
imConversationDisplayUpdate
);
return
ApiResult
.
result
(
flag
);
}
...
...
common/src/main/java/com/wecloud/im/netty/core/WsReadHandler.java
View file @
8ff4dadd
...
...
@@ -42,9 +42,9 @@ public class WsReadHandler extends SimpleChannelInboundHandler<TextWebSocketFram
* io密集型任务配置尽可能多的线程数量
*/
private
final
static
ExecutorService
TASK_THREAD_POOL_EXECUTOR
=
new
ThreadPoolExecutor
(
WsConstants
.
CPU_PROCESSORS
*
10
,
WsConstants
.
CPU_PROCESSORS
*
50
0
,
1
L
,
TimeUnit
.
MILLISECONDS
,
new
LinkedBlockingQueue
<
Runnable
>(),
NAMED_THREAD_FACTORY
,
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
new
ThreadPoolExecutor
(
WsConstants
.
CPU_PROCESSORS
*
10
,
WsConstants
.
CPU_PROCESSORS
*
2
0
,
3
L
,
TimeUnit
.
MILLISECONDS
,
new
LinkedBlockingQueue
<
Runnable
>(
2048
),
NAMED_THREAD_FACTORY
,
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
@Override
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
TextWebSocketFrame
msg
)
{
...
...
common/src/main/java/com/wecloud/im/param/add/ImConversationDisplayUpdate.java
View file @
8ff4dadd
...
...
@@ -20,11 +20,9 @@ import lombok.experimental.Accessors;
public
class
ImConversationDisplayUpdate
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"会话id"
)
@ApiModelProperty
(
value
=
"会话id"
,
required
=
true
)
private
Long
conversationId
;
@ApiModelProperty
(
"显示状态 1显示 0不显示"
)
@ApiModelProperty
(
value
=
"显示状态 1显示 0不显示"
,
required
=
true
)
private
Integer
displayStatus
;
}
common/src/main/java/com/wecloud/im/service/ImConversationService.java
View file @
8ff4dadd
...
...
@@ -54,7 +54,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
* @return
* @throws Exception
*/
boolean
d
isplayConversation
(
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
;
boolean
updateD
isplayConversation
(
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
;
/**
* 根据ID获取查询对象
...
...
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
8ff4dadd
...
...
@@ -185,7 +185,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
d
isplayConversation
(
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
{
public
boolean
updateD
isplayConversation
(
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
{
ImClient
curentClient
=
imClientService
.
getCurentClient
();
// 修改为删除隐藏状态
...
...
common/src/main/java/com/wecloud/im/ws/strategy/concrete/ImConcreteReceiveStrategy.java
View file @
8ff4dadd
...
...
@@ -92,9 +92,12 @@ public class ImConcreteReceiveStrategy extends AbstractReceiveStrategy {
}
JsonMapper
jsonMapper
=
new
JsonMapper
();
// 获取会话id
Long
toConversationId
=
Long
.
valueOf
(
receiveModel
.
getData
().
get
(
"toConversation"
).
toString
());
receiveModel
.
getData
().
remove
(
"toConversation"
);
// 生成消息id
long
messageId
=
SnowflakeUtil
.
getId
();
String
content
=
null
;
...
...
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