删除comment

This commit is contained in:
cyk 2023-12-28 22:02:44 +08:00
parent 17a208b661
commit 0f595e0476

View File

@ -1,5 +1,7 @@
package com.lovenav.controller;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.lovenav.entity.Comment;
import com.lovenav.entity.CommentNode;
import com.lovenav.entity.CommentUser;
@ -10,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
@ -66,4 +69,13 @@ public class CommentController {
public ResponseEntity<CommentUser> queryObserveUserById (Integer Id) {
return ResponseEntity.ok(commentService.queryCommentUserById(Id));
}
@RequestMapping("/deleteByCommentId")
public String deleteByCommentId(String commentId)
{
HashMap<String, Object> result = new HashMap<>();
result.put("code", 200);
result.put("msg", commentService.SelectChildAndDelete(commentId));
return JSONObject.toJSONString(result);
}
}