动态管理功能补充

This commit is contained in:
pserimal
2023-06-29 15:46:23 +08:00
parent 43dc7202bc
commit 6a68fde497
9 changed files with 119 additions and 5 deletions

View File

@@ -1,10 +1,13 @@
package com.cool.store.controller;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.content.*;
import com.cool.store.entity.HyContentInfoDO;
import com.cool.store.exception.ApiException;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ContentService;
import com.cool.store.vo.HyContentInfoVO;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
@@ -24,9 +27,15 @@ public class ContentController {
@Autowired
private ContentService contentService;
@PostMapping("/queryTitles")
@ApiOperation("搜索标题是否重复")
public ResponseResult<Boolean> queryTitles(@RequestBody ContentQueryTitlesDto title) {
return ResponseResult.success(contentService.queryTitles(title.getTittle()));
}
@PostMapping("/add")
@ApiOperation("新增动态")
public ResponseResult<String> addContent(@RequestBody ContentAddDto dto) {
public ResponseResult<String> addContent(@RequestBody ContentAddDto dto) throws ApiException {
return ResponseResult.success(contentService.addNews(dto));
}