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
082e7a72
Commit
082e7a72
authored
Dec 04, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
随机视频列表
parent
1451680b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+7
-7
MsgController.java
...rc/main/java/com/xxfc/platform/im/rest/MsgController.java
+9
-0
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
082e7a72
...
...
@@ -139,16 +139,16 @@ public class MsgBiz {
}
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"count.praise"
));
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
Set
<
Msg
>
resultList
=
new
HashSet
<>();
if
(
CollectionUtils
.
isNotEmpty
(
msgList
))
{
if
(
number
>=
msgList
.
size
())
{
return
ObjectRestResponse
.
succ
(
msgList
);
List
<
MsgVo
>
msgVoList
=
replaceMsgResult
(
msgList
);
Set
<
Msg
Vo
>
resultList
=
new
HashSet
<>();
if
(
CollectionUtils
.
isNotEmpty
(
msg
Vo
List
))
{
if
(
number
>=
msg
Vo
List
.
size
())
{
return
ObjectRestResponse
.
succ
(
msg
Vo
List
);
}
Set
<
Integer
>
set
=
new
HashSet
<>();
RandomUtil
.
randomSet
(
msgList
.
size
(),
number
,
set
,
number
);
RandomUtil
.
randomSet
(
msg
Vo
List
.
size
(),
number
,
set
,
number
);
for
(
Integer
i
:
set
)
{
resultList
.
add
(
msgList
.
get
(
i
));
resultList
.
add
(
msg
Vo
List
.
get
(
i
));
}
}
return
ObjectRestResponse
.
succ
(
resultList
);
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/MsgController.java
View file @
082e7a72
...
...
@@ -61,5 +61,14 @@ public class MsgController {
return
msgBiz
.
getMsgList
(
msgQueryDto
);
}
@GetMapping
(
value
=
"/app/unauth/getHostMsgList"
)
public
ObjectRestResponse
getHostMsgList
(
String
messageId
,
Integer
number
)
{
return
msgBiz
.
getHotMsgListWithoutOne
(
messageId
,
number
);
}
@GetMapping
(
value
=
"/app/unauth/get"
)
public
ObjectRestResponse
getDetail
(
String
id
)
{
return
msgBiz
.
get
(
id
);
}
}
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