...
|
...
|
@@ -25,6 +25,8 @@ public class PublicArticleService { |
|
|
@Resource
|
|
|
private PublicArticleAuditRepository publicArticleAuditRepository;
|
|
|
|
|
|
private static final Integer DELETE = 2;
|
|
|
|
|
|
/**
|
|
|
* 删除数据
|
|
|
*
|
...
|
...
|
@@ -36,7 +38,12 @@ public class PublicArticleService { |
|
|
log.info("get nothing from database by condition relateId and articleType with targetObject {}", targetObject.toString());
|
|
|
return;
|
|
|
}
|
|
|
publicArticleRepository.deleteById(existObject.getId());
|
|
|
existObject.setStatus(DELETE);
|
|
|
/**
|
|
|
* 2019.4.4 将文章表改为逻辑删除
|
|
|
*/
|
|
|
publicArticleRepository.save(existObject);
|
|
|
// publicArticleRepository.deleteById(existObject.getId());
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -54,6 +61,7 @@ public class PublicArticleService { |
|
|
boolean mark = true;
|
|
|
PublicArticle saveObject;
|
|
|
if (existObject != null) {
|
|
|
// update
|
|
|
mark = false;
|
|
|
targetObject.setCoverImg((String) checkResult);
|
|
|
if (targetObject.getId() != null) {
|
...
|
...
|
@@ -71,6 +79,7 @@ public class PublicArticleService { |
|
|
publicArticleAuditHandler(publicArticleAudit, existObject);
|
|
|
saveObject = publicArticleRepository.save(existObject);
|
|
|
} else {
|
|
|
// insert
|
|
|
saveObject = publicArticleRepository.save(targetObject);
|
|
|
}
|
|
|
if (mark) {
|
...
|
...
|
|