mitao
2025-03-06 01d6fa48a0de7a21988e89f71721b6b85e53b517
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.ruoyi.article.controller.management;
 
 
import com.ruoyi.article.controller.management.dto.MgtArticleCommentsQuery;
import com.ruoyi.article.controller.management.vo.MgtArticleCommentsVO;
import com.ruoyi.article.service.IArticleCommentsService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.page.PageDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
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;
 
/**
 * <p>
 * 资讯评论回复表 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2024-05-16
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/mgt/article-comments")
@Api(value = "管理后台-资讯评论回复相关接口", tags = "管理后台-资讯评论回复相关接口")
public class MgtArticleCommentsController {
 
    private final IArticleCommentsService articleCommentsService;
 
    /**
     * 查看详情-评论详情
     *
     * @param query 资讯评论回复查询对象
     * @return PageDTO<MgtArticleCommentsVO>
     */
    @ApiOperation(value = "查看详情-评论详情")
    @PostMapping("/page")
    public R<PageDTO<MgtArticleCommentsVO>> getArticleCommentsPage(
            @Validated @RequestBody MgtArticleCommentsQuery query) {
        return R.ok(articleCommentsService.getArticleCommentsPage(query));
    }
 
    /**
     * 删除评论
     *
     * @param id 评论id
     */
    @ApiOperation("删除评论")
    @DeleteMapping("/{id}")
    public R<?> delArticleComments(
            @ApiParam(name = "id", value = "评论id", required = true) @PathVariable("id") Long id) {
        articleCommentsService.delArticleComments(id);
        return R.ok();
    }
}