Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
266e20ce
Commit
266e20ce
authored
Jul 26, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
8df1667c
90a50e87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+8
-3
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
266e20ce
...
...
@@ -83,6 +83,11 @@ public class MsgBiz {
}
public
ObjectRestResponse
getHotMsgList
(
Integer
page
,
Integer
limit
)
{
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
Integer
userId
=
null
;
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
);
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
...
...
@@ -94,7 +99,7 @@ public class MsgBiz {
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"count.praise"
));
List
<
Msg
>
msgList
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
...
...
@@ -158,7 +163,7 @@ public class MsgBiz {
public
boolean
exists
(
int
userId
,
ObjectId
msgId
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
msgId
).
and
(
"userId"
).
is
(
userId
));
List
<
Praise
>
praise
=
mongoTemplate
.
find
(
query
,
Praise
.
class
,
"s_praise"
);
return
0
!=
praise
.
size
()
;
return
praise
.
size
()
>
0
?
true
:
false
;
}
/**
...
...
@@ -171,7 +176,7 @@ public class MsgBiz {
public
boolean
existsCollect
(
int
userId
,
ObjectId
msgId
)
{
Query
query
=
new
Query
(
Criteria
.
where
(
"msgId"
).
is
(
msgId
).
and
(
"userId"
).
is
(
userId
));
List
<
Comment
>
comments
=
mongoTemplate
.
find
(
query
,
Comment
.
class
,
"s_comment"
);
return
0
!=
comments
.
size
()
;
return
comments
.
size
()
>
0
?
true
:
false
;
}
public
List
<
MsgVo
>
replaceMsgResult
(
List
<
Msg
>
list
)
{
...
...
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