|
@@ -153,6 +153,7 @@ public class NewsArticleServiceImpl extends BaseService implements NewsArticleSe
|
|
|
photoDto.setName(newsArticleDto.getTitle());
|
|
|
photoDto.setType(PhotoTypeEnum.NEWS_PHOTO.getValue());
|
|
|
photoDto.setStatus(PhotoStatusEnum.UPLOAD_SUCCESS_HAVE_USED.getValue());
|
|
|
+
|
|
|
PhotoVo photoVo = photoService.savePhoto(photoDto);
|
|
|
newsArticlePo.setPhotoId(photoVo.getId());
|
|
|
} catch (ServiceException e) {
|
|
@@ -160,6 +161,7 @@ public class NewsArticleServiceImpl extends BaseService implements NewsArticleSe
|
|
|
throw new ServiceException("更换新闻封面图失败");
|
|
|
}
|
|
|
}
|
|
|
+ newsArticlePo.setPhotoUrl(null);
|
|
|
mapper.updateById(newsArticlePo);
|
|
|
} catch (Exception e) {
|
|
|
log.error("编辑新闻失败,失败原因:{}", e.getMessage());
|
|
@@ -173,7 +175,7 @@ public class NewsArticleServiceImpl extends BaseService implements NewsArticleSe
|
|
|
NewsArticlePo newsArticlePo = mapper.getNewsArticleById(id);
|
|
|
newsArticlePo.setActivated(CommonConstant.ACTIVATED_DELETED);
|
|
|
newsArticlePo.setUpdateTime(new Date());
|
|
|
-
|
|
|
+ newsArticlePo.setPhotoUrl(null);
|
|
|
try {
|
|
|
mapper.updateById(newsArticlePo);
|
|
|
} catch (Exception e) {
|