Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
81ba524f
Commit
81ba524f
authored
Oct 29, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
屏蔽手机号
parent
efb25a22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+0
-3
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+8
-7
No files found.
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
View file @
81ba524f
...
@@ -15,7 +15,6 @@ import com.tanpu.community.api.enums.ThemeTypeEnum;
...
@@ -15,7 +15,6 @@ import com.tanpu.community.api.enums.ThemeTypeEnum;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.TimesCountEntity
;
import
com.tanpu.community.dao.entity.community.TimesCountEntity
;
import
com.tanpu.community.dao.mapper.community.ThemeMapper
;
import
com.tanpu.community.dao.mapper.community.ThemeMapper
;
import
com.tanpu.community.util.OtherUtil
;
import
com.tanpu.community.util.TimeUtils
;
import
com.tanpu.community.util.TimeUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -90,7 +89,6 @@ public class ThemeService {
...
@@ -90,7 +89,6 @@ public class ThemeService {
public
ThemeEntity
queryByThemeIdIgnoreDelete
(
String
themeId
)
{
public
ThemeEntity
queryByThemeIdIgnoreDelete
(
String
themeId
)
{
ThemeEntity
themeEntity
=
themeMapper
.
selectOne
(
new
LambdaQueryWrapper
<
ThemeEntity
>()
ThemeEntity
themeEntity
=
themeMapper
.
selectOne
(
new
LambdaQueryWrapper
<
ThemeEntity
>()
.
eq
(
ThemeEntity:
:
getThemeId
,
themeId
));
.
eq
(
ThemeEntity:
:
getThemeId
,
themeId
));
themeEntity
.
setContent
(
OtherUtil
.
blockPhoneAndEmail
(
themeEntity
.
getContent
()));
return
themeEntity
;
return
themeEntity
;
}
}
...
@@ -145,7 +143,6 @@ public class ThemeService {
...
@@ -145,7 +143,6 @@ public class ThemeService {
.
eq
(
ThemeEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
());
.
eq
(
ThemeEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
());
List
<
ThemeEntity
>
themeEntities
=
themeMapper
.
selectList
(
queryWrapper
);
List
<
ThemeEntity
>
themeEntities
=
themeMapper
.
selectList
(
queryWrapper
);
themeEntities
.
forEach
(
o
->
o
.
setContent
(
OtherUtil
.
blockPhoneAndEmail
(
o
.
getContent
())));
return
themeEntities
;
return
themeEntities
;
}
}
...
...
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
81ba524f
...
@@ -47,7 +47,8 @@ public class ConvertUtil {
...
@@ -47,7 +47,8 @@ public class ConvertUtil {
themeQO
.
setCreateTime
(
TimeUtils
.
getTimestampOfDateTime
(
themeEntity
.
getCreateTime
()));
themeQO
.
setCreateTime
(
TimeUtils
.
getTimestampOfDateTime
(
themeEntity
.
getCreateTime
()));
themeQO
.
setUpToNowTime
(
TimeUtils
.
calUpToNowTime
(
themeEntity
.
getCreateTime
()));
themeQO
.
setUpToNowTime
(
TimeUtils
.
calUpToNowTime
(
themeEntity
.
getCreateTime
()));
themeQO
.
setFormatTime
(
TimeUtils
.
format
(
themeEntity
.
getCreateTime
()));
themeQO
.
setFormatTime
(
TimeUtils
.
format
(
themeEntity
.
getCreateTime
()));
List
<
ThemeContentQo
>
themeContentQos
=
JsonUtil
.
toBean
(
themeEntity
.
getContent
(),
new
TypeReference
<
List
<
ThemeContentQo
>>()
{
// 屏蔽手机号和邮箱
List
<
ThemeContentQo
>
themeContentQos
=
JsonUtil
.
toBean
(
OtherUtil
.
blockPhoneAndEmail
(
themeEntity
.
getContent
()),
new
TypeReference
<
List
<
ThemeContentQo
>>()
{
});
});
themeQO
.
setContent
(
themeContentQos
);
themeQO
.
setContent
(
themeContentQos
);
return
themeQO
;
return
themeQO
;
...
@@ -279,13 +280,13 @@ public class ConvertUtil {
...
@@ -279,13 +280,13 @@ public class ConvertUtil {
themeNotifyQo
.
setFormerThemeId
(
entity
.
getTargetId
());
themeNotifyQo
.
setFormerThemeId
(
entity
.
getTargetId
());
themeNotifyQo
.
setFormerUserName
(
entity
.
getNotifiedUserId
());
themeNotifyQo
.
setFormerUserName
(
entity
.
getNotifiedUserId
());
if
(!
StringUtils
.
isEmpty
(
entity
.
getContent
()))
{
if
(!
StringUtils
.
isEmpty
(
entity
.
getContent
()))
{
try
{
try
{
NotificationForwardDO
forwardDO
=
JsonUtil
.
toBean
(
entity
.
getContent
(),
NotificationForwardDO
.
class
);
NotificationForwardDO
forwardDO
=
JsonUtil
.
toBean
(
entity
.
getContent
(),
NotificationForwardDO
.
class
);
themeNotifyQo
.
setContent
(
forwardDO
.
getContent
());
themeNotifyQo
.
setContent
(
forwardDO
.
getContent
());
themeNotifyQo
.
setTopicId
(
forwardDO
.
getTopicId
());
themeNotifyQo
.
setTopicId
(
forwardDO
.
getTopicId
());
themeNotifyQo
.
setForwardThemeId
(
forwardDO
.
getThemeId
());
themeNotifyQo
.
setForwardThemeId
(
forwardDO
.
getThemeId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
BizException
(
"消息通知-转发类型-反序列化异常:"
+
entity
.
getContent
());
throw
new
BizException
(
"消息通知-转发类型-反序列化异常:"
+
entity
.
getContent
());
}
}
}
}
}
}
...
@@ -298,10 +299,10 @@ public class ConvertUtil {
...
@@ -298,10 +299,10 @@ public class ConvertUtil {
NotificationLikeDO
notificationLikeDO
=
JsonUtil
.
toBean
(
entity
.
getContent
(),
NotificationLikeDO
.
class
);
NotificationLikeDO
notificationLikeDO
=
JsonUtil
.
toBean
(
entity
.
getContent
(),
NotificationLikeDO
.
class
);
themeNotifyQo
.
setLikeUserCount
(
notificationLikeDO
.
getCount
());
themeNotifyQo
.
setLikeUserCount
(
notificationLikeDO
.
getCount
());
ArrayList
<
UserBriefInfoQO
>
likeUsers
=
new
ArrayList
<>();
ArrayList
<
UserBriefInfoQO
>
likeUsers
=
new
ArrayList
<>();
notificationLikeDO
.
getSet
().
stream
().
forEach
(
o
->
likeUsers
.
add
(
UserBriefInfoQO
.
builder
().
userId
(
o
).
build
()));
notificationLikeDO
.
getSet
().
stream
().
forEach
(
o
->
likeUsers
.
add
(
UserBriefInfoQO
.
builder
().
userId
(
o
).
build
()));
themeNotifyQo
.
setLikeUsers
(
likeUsers
);
themeNotifyQo
.
setLikeUsers
(
likeUsers
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
BizException
(
"消息通知-点赞类型-反序列化异常:"
+
entity
.
getContent
());
throw
new
BizException
(
"消息通知-点赞类型-反序列化异常:"
+
entity
.
getContent
());
}
}
}
}
}
}
...
...
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