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();
|
}
|
}
|