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
7833928c
Commit
7833928c
authored
Jul 19, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加积分消息队列接口
parent
0e007d09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+11
-4
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
7833928c
...
@@ -45,7 +45,10 @@ public class MsgBiz {
...
@@ -45,7 +45,10 @@ public class MsgBiz {
public
ObjectRestResponse
getMsgList
(
Integer
page
,
Integer
limit
,
Integer
type
)
throws
Exception
{
public
ObjectRestResponse
getMsgList
(
Integer
page
,
Integer
limit
,
Integer
type
)
throws
Exception
{
//获取所有朋友圈
//获取所有朋友圈
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
Integer
userId
=
null
;
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
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
;
...
@@ -54,7 +57,7 @@ public class MsgBiz {
...
@@ -54,7 +57,7 @@ public class MsgBiz {
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
));
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
appUserDTO
.
getImUserid
()
);
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
);
}
else
{
}
else
{
...
@@ -62,7 +65,7 @@ public class MsgBiz {
...
@@ -62,7 +65,7 @@ public class MsgBiz {
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
));
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
appUserDTO
.
getImUserid
()
);
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
);
}
}
...
@@ -87,11 +90,15 @@ public class MsgBiz {
...
@@ -87,11 +90,15 @@ public class MsgBiz {
public
ObjectRestResponse
get
(
String
id
){
public
ObjectRestResponse
get
(
String
id
){
//获取所有朋友圈
//获取所有朋友圈
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
AppUserDTO
appUserDTO
=
userBiz
.
getUserInfo
();
Integer
userId
=
null
;
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
if
(
id
==
null
)
{
if
(
id
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
}
Query
query
=
new
Query
(
Criteria
.
where
(
"id"
).
is
(
new
ObjectId
(
id
)));
Query
query
=
new
Query
(
Criteria
.
where
(
"id"
).
is
(
new
ObjectId
(
id
)));
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
appUserDTO
.
getImUserid
()
);
List
<
Msg
>
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
List
<
MsgVo
>
msgVoList
=
replaceMsgResult
(
msgList
);
List
<
MsgVo
>
msgVoList
=
replaceMsgResult
(
msgList
);
if
(
msgVoList
.
size
()
>
0
)
{
if
(
msgVoList
.
size
()
>
0
)
{
return
ObjectRestResponse
.
succ
(
msgVoList
.
get
(
0
));
return
ObjectRestResponse
.
succ
(
msgVoList
.
get
(
0
));
...
...
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