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
e3824f42
Commit
e3824f42
authored
Dec 11, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
eda33414
432c9e4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+16
-9
DictionaryKey.java
...a/com/xxfc/platform/universal/constant/DictionaryKey.java
+6
-0
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
e3824f42
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.im.biz;
...
@@ -3,6 +3,7 @@ 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.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
...
@@ -13,6 +14,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...
@@ -13,6 +14,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.github.wxiaoqi.security.common.util.RandomUtil
;
import
com.github.wxiaoqi.security.common.util.RandomUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.google.common.collect.Lists
;
import
com.mongodb.client.result.DeleteResult
;
import
com.mongodb.client.result.DeleteResult
;
import
com.mongodb.client.result.UpdateResult
;
import
com.mongodb.client.result.UpdateResult
;
import
com.xxfc.platform.im.dto.CommentVo
;
import
com.xxfc.platform.im.dto.CommentVo
;
...
@@ -88,9 +90,7 @@ public class MsgBiz {
...
@@ -88,9 +90,7 @@ public class MsgBiz {
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
else
{
}
else
{
List
<
Integer
>
ids
=
new
ArrayList
<>();
List
<
Integer
>
ids
=
getType
();
ids
.
add
(
2
);
ids
.
add
(
4
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
).
and
(
"visible"
).
is
(
1
));
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
).
and
(
"visible"
).
is
(
1
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
query
.
with
(
pageable
);
...
@@ -113,9 +113,7 @@ public class MsgBiz {
...
@@ -113,9 +113,7 @@ public class MsgBiz {
page
=
page
==
null
?
1
:
page
;
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
limit
=
limit
==
null
?
10
:
limit
;
Pageable
pageable
=
PageRequest
.
of
(--
page
,
limit
);
Pageable
pageable
=
PageRequest
.
of
(--
page
,
limit
);
List
<
Integer
>
ids
=
new
ArrayList
<>();
List
<
Integer
>
ids
=
getType
();
ids
.
add
(
2
);
ids
.
add
(
4
);
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
).
and
(
"count.praise"
).
gt
(
getNumber
()).
and
(
"visible"
).
is
(
1
));
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
).
and
(
"count.praise"
).
gt
(
getNumber
()).
and
(
"visible"
).
is
(
1
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
query
.
with
(
pageable
);
...
@@ -370,6 +368,17 @@ public class MsgBiz {
...
@@ -370,6 +368,17 @@ public class MsgBiz {
}
}
public
List
<
Integer
>
getType
()
{
List
<
Integer
>
list
=
Lists
.
newArrayList
();
Dictionary
dictionary
=
thirdFeign
.
findDictionaryByTypeAndCode
(
IM_TYPE
,
DictionaryKey
.
IM_MSG_TYPE_LIST
);
if
(
dictionary
!=
null
&&
StringUtils
.
isNotBlank
(
dictionary
.
getDetail
()))
{
log
.
info
(
"查询IM限制数为字典表的结果为: dictionary = {}"
,
dictionary
.
toString
());
list
=
JSONArray
.
parseArray
(
dictionary
.
getDetail
(),
Integer
.
class
);
}
return
list
;
}
/**
/**
* 后台管理接口
* 后台管理接口
*/
*/
...
@@ -427,9 +436,7 @@ public class MsgBiz {
...
@@ -427,9 +436,7 @@ public class MsgBiz {
goodPageInfo
.
setTotal
(
totalSize
);
goodPageInfo
.
setTotal
(
totalSize
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
else
{
}
else
{
List
<
Integer
>
ids
=
new
ArrayList
<>();
List
<
Integer
>
ids
=
getType
();
ids
.
add
(
2
);
ids
.
add
(
4
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
query
.
with
(
pageable
);
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
View file @
e3824f42
...
@@ -37,6 +37,12 @@ public class DictionaryKey {
...
@@ -37,6 +37,12 @@ public class DictionaryKey {
* IM限制条数
* IM限制条数
*/
*/
public
static
final
String
MSG_LIMIT_NUMBER
=
"MSG_LIMIT_NUMBER"
;
public
static
final
String
MSG_LIMIT_NUMBER
=
"MSG_LIMIT_NUMBER"
;
/**
*
*/
public
static
final
String
IM_MSG_TYPE_LIST
=
"IM_MSG_TYPE_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