From fa668c325f2dac348fb9f80c0c6c679f9ce1e41b Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期二, 10 三月 2026 18:28:17 +0800
Subject: [PATCH] 小程序   接口开发

---
 server/dmmall_web/src/main/java/com/doumee/api/web/CommentApi.java |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/server/dmmall_web/src/main/java/com/doumee/api/web/CommentApi.java b/server/dmmall_web/src/main/java/com/doumee/api/web/CommentApi.java
index a4011d2..f17d742 100644
--- a/server/dmmall_web/src/main/java/com/doumee/api/web/CommentApi.java
+++ b/server/dmmall_web/src/main/java/com/doumee/api/web/CommentApi.java
@@ -1,5 +1,6 @@
 package com.doumee.api.web;
 
+import com.doumee.config.annotation.LoginRequired;
 import com.doumee.core.annotation.pr.PreventRepeat;
 import com.doumee.core.model.ApiResponse;
 import com.doumee.core.model.PageData;
@@ -8,13 +9,11 @@
 import com.doumee.dao.web.dto.CommentDTO;
 import com.doumee.dao.web.dto.activity.ActivityCommentDTO;
 import com.doumee.dao.web.dto.activity.ActivityReplyCommentDTO;
+import com.doumee.dao.web.request.CommentApplyRequest;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author 姹熻箘韫�
@@ -26,12 +25,20 @@
 public class CommentApi extends ApiController{
 
 
-    @PreventRepeat
-    @ApiOperation("鏂板缓")
-    @PostMapping("/create")
-    @RequiresPermissions("business:comment:create")
-    public ApiResponse create(@RequestBody Comment comment) {
-        return ApiResponse.success(commentService.create(comment,getMemberId()));
+    @LoginRequired
+    @ApiOperation("鍙戝竷璇勮")
+    @PostMapping("/apply")
+    public ApiResponse<Comment> apply(@RequestBody CommentApplyRequest comment) {
+        return ApiResponse.success(commentService.apply(comment,getMemberId()));
+    }
+
+
+    @LoginRequired
+    @ApiOperation("鍒犻櫎璇勮")
+    @GetMapping("/delete/{id}")
+    public ApiResponse deleteById(@PathVariable Integer id) {
+        commentService.deleteById(id,getMemberId());
+        return ApiResponse.success(null);
     }
 
 
@@ -41,7 +48,6 @@
      * @param pageWrap 鍒嗛〉瀵硅薄
      * @return PageData<Comment>
      */
-    @PreventRepeat
     @ApiOperation("鍒嗛〉娲诲姩鎺㈠簵璇勮鏌ヨ")
     @PostMapping("/findActivityCommentDTOPage")
     public ApiResponse<PageData<ActivityCommentDTO>> findActivityCommentDTOPage(@RequestBody PageWrap<CommentDTO> pageWrap){
@@ -54,7 +60,6 @@
      * @param pageWrap 鍒嗛〉瀵硅薄
      * @return PageData<Comment>
      */
-    @PreventRepeat
     @ApiOperation("鍒嗛〉娲诲姩鎺㈠簵璇勮鍥炲鏌ヨ")
     @PostMapping("/findActivityReplyCommentDTOPage")
     public ApiResponse<PageData<ActivityReplyCommentDTO>> findActivityReplyCommentDTOPage(@RequestBody PageWrap<CommentDTO> pageWrap){

--
Gitblit v1.9.3