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
75e4555b
Commit
75e4555b
authored
May 23, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息数量控制修改按天
parent
229eeaf5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
+20
-1
core/src/main/java/com/wecloud/im/action/NormalChatAction.java
+20
-1
No files found.
core/src/main/java/com/wecloud/im/action/NormalChatAction.java
View file @
75e4555b
...
@@ -8,6 +8,7 @@ import io.swagger.annotations.Api;
...
@@ -8,6 +8,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -390,7 +391,7 @@ public class NormalChatAction {
...
@@ -390,7 +391,7 @@ public class NormalChatAction {
}
}
int
sendCount
=
int
sendCount
=
imMessageService
.
count
(
Wrappers
.<
ImMessage
>
lambdaQuery
().
eq
(
ImMessage:
:
getFkConversationId
,
imMessageService
.
count
(
Wrappers
.<
ImMessage
>
lambdaQuery
().
eq
(
ImMessage:
:
getFkConversationId
,
conversationId
).
eq
(
ImMessage:
:
getSender
,
imClientSender
.
getId
()));
conversationId
).
eq
(
ImMessage:
:
getSender
,
imClientSender
.
getId
())
.
between
(
ImMessage:
:
getCreateTime
,
getStartTime
(),
getEndTime
())
);
if
(!
isVip
)
{
if
(!
isVip
)
{
// 判断消息发送数量
// 判断消息发送数量
if
(
sendCount
>=
3
)
{
if
(
sendCount
>=
3
)
{
...
@@ -555,5 +556,23 @@ public class NormalChatAction {
...
@@ -555,5 +556,23 @@ public class NormalChatAction {
}
}
private
Date
getStartTime
()
{
Calendar
todayStart
=
Calendar
.
getInstance
();
todayStart
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
todayStart
.
set
(
Calendar
.
MINUTE
,
0
);
todayStart
.
set
(
Calendar
.
SECOND
,
0
);
todayStart
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
todayStart
.
getTime
();
}
private
Date
getEndTime
()
{
Calendar
todayEnd
=
Calendar
.
getInstance
();
todayEnd
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
todayEnd
.
set
(
Calendar
.
MINUTE
,
59
);
todayEnd
.
set
(
Calendar
.
SECOND
,
59
);
todayEnd
.
set
(
Calendar
.
MILLISECOND
,
999
);
return
todayEnd
.
getTime
();
}
}
}
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