处理列表图片问题

This commit is contained in:
WenG 2020-11-30 23:41:43 +08:00
parent 95136bda9e
commit e3c00ce7e7
2 changed files with 6 additions and 9 deletions

View File

@ -197,9 +197,6 @@ public class NewsContentAppDTO implements Serializable {
}
public List<NewsLabelConfigDTO> getNewsContentLabelList() {
if(this.newsContentLabelList == null) {
this.newsContentLabelList = new ArrayList<>();
}
return newsContentLabelList;
}

View File

@ -414,19 +414,19 @@ public class NewsContentServiceImpl extends BaseService implements INewsContentS
}
for (NewsContentAppDTO appDTO : newsContentDTOs) {
// 第一步 查找封面图片
List<NewsContentCoverDTO> newsContentCoverDTOs = new ArrayList<>();
appDTO.setNewsContentCoverList(newsContentCoverDTOs);
for (NewsContentCoverDTO newsContentCoverDTO : converList) {
if (StringUtils.equals(appDTO.getNewsContentId(), newsContentCoverDTO.getNewsContentId())) {
if(appDTO.getNewsContentCoverList().isEmpty()) {
appDTO.getNewsContentCoverList().add(newsContentCoverDTO);
} else {
break;
}
newsContentCoverDTOs.add(newsContentCoverDTO);
}
}
// 第二步 查找配置的标签项
List<NewsLabelConfigDTO> newsLabelConfigDTOs = new ArrayList<>();
appDTO.setNewsContentLabelList(newsLabelConfigDTOs);
for (NewsLabelConfigDTO newsLabelConfigDTO : configList) {
if (StringUtils.equals(appDTO.getNewsContentId(), newsLabelConfigDTO.getNewsContentId())) {
appDTO.getNewsContentLabelList().add(newsLabelConfigDTO);
newsLabelConfigDTOs.add(newsLabelConfigDTO);
}
}
// 第三步 查找评论数