rk
2026-03-10 fa668c325f2dac348fb9f80c0c6c679f9ce1e41b
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){