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
2a2c9c5a
Commit
2a2c9c5a
authored
Aug 12, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
灵活配置该应用 是否允许重复创建会话
parent
f850d119
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
common/src/main/java/com/wecloud/im/controller/ImConversationController.java
+4
-4
common/src/main/java/com/wecloud/im/netty/core/NettyStart.java
+7
-2
No files found.
common/src/main/java/com/wecloud/im/controller/ImConversationController.java
View file @
2a2c9c5a
...
@@ -37,7 +37,7 @@ public class ImConversationController extends BaseController {
...
@@ -37,7 +37,7 @@ public class ImConversationController extends BaseController {
* 创建会话
* 创建会话
*/
*/
@PostMapping
(
"/create"
)
@PostMapping
(
"/create"
)
@ApiOperation
(
value
=
"创建会话"
,
notes
=
"
两个用户如果已经创建过会话,不能
重复创建会话"
)
@ApiOperation
(
value
=
"创建会话"
,
notes
=
"
后台可配置:两个客户端如果已经创建过会话,是否
重复创建会话"
)
public
ApiResult
<
ImConversationCreateVo
>
createImConversation
(
@RequestBody
ImConversationCreate
imConversationCreate
)
throws
Exception
{
public
ApiResult
<
ImConversationCreateVo
>
createImConversation
(
@RequestBody
ImConversationCreate
imConversationCreate
)
throws
Exception
{
ApiResult
<
ImConversationCreateVo
>
imConversation
=
imConversationService
.
createImConversation
(
imConversationCreate
);
ApiResult
<
ImConversationCreateVo
>
imConversation
=
imConversationService
.
createImConversation
(
imConversationCreate
);
return
imConversation
;
return
imConversation
;
...
@@ -47,17 +47,17 @@ public class ImConversationController extends BaseController {
...
@@ -47,17 +47,17 @@ public class ImConversationController extends BaseController {
* 查询用户加入的所有会话 与每个会话的未读条数 成员
* 查询用户加入的所有会话 与每个会话的未读条数 成员
*/
*/
@PostMapping
(
"/getList"
)
@PostMapping
(
"/getList"
)
@ApiOperation
(
value
=
"查询加入的会话列表"
,
notes
=
"查询用户加入的会话列表 与每个会话的未读条数 成员"
)
@ApiOperation
(
value
=
"查询加入的会话列表"
,
notes
=
"查询用户加入的
非隐藏状态的
会话列表 与每个会话的未读条数 成员"
)
public
ApiResult
<
List
<
MyConversationListVo
>>
getMyImConversationListAndMsgCount
()
throws
Exception
{
public
ApiResult
<
List
<
MyConversationListVo
>>
getMyImConversationListAndMsgCount
()
throws
Exception
{
List
<
MyConversationListVo
>
conversationList
=
imConversationService
.
getMyImConversationListAndMsgCount
();
List
<
MyConversationListVo
>
conversationList
=
imConversationService
.
getMyImConversationListAndMsgCount
();
return
ApiResult
.
ok
(
conversationList
);
return
ApiResult
.
ok
(
conversationList
);
}
}
/**
/**
* 修改
是否单向隐藏
会话
* 修改
单向隐藏或显示
会话
*/
*/
@PostMapping
(
"/displayUpdate"
)
@PostMapping
(
"/displayUpdate"
)
@ApiOperation
(
value
=
"修改
是否单向隐藏会话"
,
notes
=
"
云端聊天记录不删除;假设有A和B两个用户,A删会话,B还能发; 如果B发了消息,A这边要重新把会话显示出来,并能显示之前的聊天记录"
)
@ApiOperation
(
value
=
"修改
单向隐藏或显示会话"
,
notes
=
"拉取会话列表不展示已隐藏状态的会话,
云端聊天记录不删除;假设有A和B两个用户,A删会话,B还能发; 如果B发了消息,A这边要重新把会话显示出来,并能显示之前的聊天记录"
)
public
ApiResult
<
Boolean
>
updateDisplayConversation
(
@RequestBody
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
{
public
ApiResult
<
Boolean
>
updateDisplayConversation
(
@RequestBody
ImConversationDisplayUpdate
imConversationDisplayUpdate
)
throws
Exception
{
boolean
flag
=
imConversationService
.
updateDisplayConversation
(
imConversationDisplayUpdate
);
boolean
flag
=
imConversationService
.
updateDisplayConversation
(
imConversationDisplayUpdate
);
return
ApiResult
.
result
(
flag
);
return
ApiResult
.
result
(
flag
);
...
...
common/src/main/java/com/wecloud/im/netty/core/NettyStart.java
View file @
2a2c9c5a
...
@@ -30,8 +30,13 @@ public class NettyStart {
...
@@ -30,8 +30,13 @@ public class NettyStart {
// 设置不延迟发送TCP_NODELAY=true
// 设置不延迟发送TCP_NODELAY=true
serverBootstrap
.
childOption
(
ChannelOption
.
TCP_NODELAY
,
true
);
serverBootstrap
.
childOption
(
ChannelOption
.
TCP_NODELAY
,
true
);
// 初始化服务端可连接队列
// // 初始化服务端可连接队列
serverBootstrap
.
option
(
ChannelOption
.
SO_BACKLOG
,
1000
);
// serverBootstrap.option(ChannelOption.SO_BACKLOG, 1000);
// //read缓存区 256k
// serverBootstrap.option(ChannelOption.SO_RCVBUF, 256 * 1024);
// // write缓存区 256k
// serverBootstrap.option(ChannelOption.SO_SNDBUF, 256 * 1024);
// 配置io模型为nio非阻塞
// 配置io模型为nio非阻塞
serverBootstrap
.
channel
(
NioServerSocketChannel
.
class
);
serverBootstrap
.
channel
(
NioServerSocketChannel
.
class
);
...
...
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