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
9db4f363
Commit
9db4f363
authored
Jul 20, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
31863231
c43268f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+7
-6
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
9db4f363
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.im.biz;
...
@@ -3,7 +3,6 @@ package com.xxfc.platform.im.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
...
@@ -18,6 +17,8 @@ import com.xxfc.platform.im.vo.MsgVo;
...
@@ -18,6 +17,8 @@ import com.xxfc.platform.im.vo.MsgVo;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bson.types.ObjectId
;
import
org.bson.types.ObjectId
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
@@ -52,11 +53,11 @@ public class MsgBiz {
...
@@ -52,11 +53,11 @@ public class MsgBiz {
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
,
type
);
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
,
type
);
page
=
page
==
null
?
1
:
page
;
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
limit
=
limit
==
null
?
10
:
limit
;
Page
Helper
.
startPage
(
page
,
limit
);
Page
able
pageable
=
PageRequest
.
of
(--
page
,
limit
);
Query
query
=
null
;
Query
query
=
null
;
List
<
Msg
>
msgList
=
null
;
List
<
Msg
>
msgList
=
null
;
if
(
type
!=
null
)
{
if
(
type
!=
null
)
{
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
is
(
type
));
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
is
(
type
))
.
with
(
pageable
)
;
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
...
@@ -64,7 +65,7 @@ public class MsgBiz {
...
@@ -64,7 +65,7 @@ public class MsgBiz {
List
<
Integer
>
ids
=
new
ArrayList
<>();
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
2
);
ids
.
add
(
4
);
ids
.
add
(
4
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
))
.
with
(
pageable
)
;
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
...
@@ -76,11 +77,11 @@ public class MsgBiz {
...
@@ -76,11 +77,11 @@ public class MsgBiz {
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
);
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
);
page
=
page
==
null
?
1
:
page
;
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
limit
=
limit
==
null
?
10
:
limit
;
Page
Helper
.
startPage
(
page
,
limit
);
Page
able
pageable
=
PageRequest
.
of
(--
page
,
limit
);
List
<
Integer
>
ids
=
new
ArrayList
<>();
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
2
);
ids
.
add
(
4
);
ids
.
add
(
4
);
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
))
.
with
(
pageable
)
;
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"count.praise"
));
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"count.praise"
));
List
<
Msg
>
msgList
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
List
<
Msg
>
msgList
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
...
...
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