Merge remote-tracking branch 'yx/master-0623-lyc' into test

This commit is contained in:
joshen
2025-07-04 14:19:24 +08:00

View File

@@ -75,6 +75,7 @@ public class CommentsServiceImpl implements ICommentsService{
c.setPraises(0);
c.setFavorites(0);
dao.save(c);
callback.increase(BoedxResourceType.toEnum(c.getObjType()),c.getObjId(), BoedxHitsField.Comments);
if(c.getParentRead()!=null && c.getParentRead()) {
dao.updateMultiFieldById(c.getParentId(),
UpdateBuilder.create("replys","replys+1",FieldUpdateType.EXPRESSION),
@@ -87,9 +88,11 @@ public class CommentsServiceImpl implements ICommentsService{
@Override
public void deleteReply(String id,String parentId) {
Comments comment=dao.get(id);
dao.deleteById(id);
dao.updateMultiFieldById(parentId, UpdateBuilder.create("replys","replys-1",FieldUpdateType.EXPRESSION));
//需要同时回调处理,修改对应的内容的评论数量
callback.reduce(BoedxResourceType.toEnum(comment.getObjType()),comment.getObjId(),BoedxHitsField.Comments);
}
@Override