Commit 81ba524f authored by 刘基明's avatar 刘基明

屏蔽手机号

parent efb25a22
......@@ -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.TimesCountEntity;
import com.tanpu.community.dao.mapper.community.ThemeMapper;
import com.tanpu.community.util.OtherUtil;
import com.tanpu.community.util.TimeUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -90,7 +89,6 @@ public class ThemeService {
public ThemeEntity queryByThemeIdIgnoreDelete(String themeId) {
ThemeEntity themeEntity = themeMapper.selectOne(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getThemeId, themeId));
themeEntity.setContent(OtherUtil.blockPhoneAndEmail(themeEntity.getContent()));
return themeEntity;
}
......@@ -145,7 +143,6 @@ public class ThemeService {
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
List<ThemeEntity> themeEntities = themeMapper.selectList(queryWrapper);
themeEntities.forEach(o->o.setContent(OtherUtil.blockPhoneAndEmail(o.getContent())));
return themeEntities;
}
......
......@@ -47,7 +47,8 @@ public class ConvertUtil {
themeQO.setCreateTime(TimeUtils.getTimestampOfDateTime(themeEntity.getCreateTime()));
themeQO.setUpToNowTime(TimeUtils.calUpToNowTime(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);
return themeQO;
......@@ -279,13 +280,13 @@ public class ConvertUtil {
themeNotifyQo.setFormerThemeId(entity.getTargetId());
themeNotifyQo.setFormerUserName(entity.getNotifiedUserId());
if (!StringUtils.isEmpty(entity.getContent())) {
try{
try {
NotificationForwardDO forwardDO = JsonUtil.toBean(entity.getContent(), NotificationForwardDO.class);
themeNotifyQo.setContent(forwardDO.getContent());
themeNotifyQo.setTopicId(forwardDO.getTopicId());
themeNotifyQo.setForwardThemeId(forwardDO.getThemeId());
}catch (Exception e){
throw new BizException("消息通知-转发类型-反序列化异常:"+ entity.getContent());
} catch (Exception e) {
throw new BizException("消息通知-转发类型-反序列化异常:" + entity.getContent());
}
}
}
......@@ -298,10 +299,10 @@ public class ConvertUtil {
NotificationLikeDO notificationLikeDO = JsonUtil.toBean(entity.getContent(), NotificationLikeDO.class);
themeNotifyQo.setLikeUserCount(notificationLikeDO.getCount());
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);
}catch (Exception e){
throw new BizException("消息通知-点赞类型-反序列化异常:"+ entity.getContent());
} catch (Exception e) {
throw new BizException("消息通知-点赞类型-反序列化异常:" + entity.getContent());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment