|
@@ -290,7 +290,28 @@ public class TravelNotesCommentController {
|
|
|
return ResponseResult.success();
|
|
|
}
|
|
|
//删除评论接口
|
|
|
- //1.删除自己写的评论;2.删除自己写的游记的评论
|
|
|
+ //1.删除自己写的评论;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除自己写的评论。
|
|
|
+ *
|
|
|
+ * @param commentId 评论id。
|
|
|
+ * @return 应答结果对象,包含新增对象主键Id。
|
|
|
+ */
|
|
|
+ @OperationLog(type = SysOperationLogType.ADD)
|
|
|
+ @PostMapping("/myCommentDel")
|
|
|
+ public ResponseResult<Void> myCommentDel(@RequestBody Long commentId){
|
|
|
+ //先校验评论id是否为自己的评论
|
|
|
+ TourTravelNotesComment tourTravelNotesComment = tourTravelNotesCommentService.getById(commentId);
|
|
|
+ //是自己的评论,直接进行删除
|
|
|
+ if(tourTravelNotesComment.getCommentUserId().equals(TokenData.takeFromRequest().getUserId())){
|
|
|
+ tourTravelNotesCommentService.remove(commentId);
|
|
|
+ }else{
|
|
|
+ return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST,"不是自己的评论,无法删除");
|
|
|
+ }
|
|
|
+ return ResponseResult.success();
|
|
|
+ }
|
|
|
+ // 2.删除自己写的游记的评论
|
|
|
//群聊详情接口
|
|
|
//举报评论接口
|
|
|
|