动态管理
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.cool.store.dto.content.ContentAddDto;
|
||||||
|
import com.cool.store.dto.content.ContentQueryListDto;
|
||||||
|
import com.cool.store.dto.content.ContentUpdateDto;
|
||||||
|
import com.cool.store.entity.HyContentInfoDO;
|
||||||
|
import com.cool.store.mapper.HyContentInfoMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
@Deprecated
|
||||||
|
public class ContentDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HyContentInfoMapper contentInfoMapper;
|
||||||
|
|
||||||
|
public String addContentInfo(ContentAddDto dto) {
|
||||||
|
HyContentInfoDO hyContentInfoDO = new HyContentInfoDO();
|
||||||
|
BeanUtil.copyProperties(dto, hyContentInfoDO);
|
||||||
|
hyContentInfoDO.setUpdateUserId(dto.getCreateUserId());
|
||||||
|
return Integer.toString(contentInfoMapper.insertSelective(hyContentInfoDO));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteContent(String contentId) {
|
||||||
|
contentInfoMapper.deleteSelective(contentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateContent(ContentUpdateDto dto) {
|
||||||
|
HyContentInfoDO hyContentInfoDO = new HyContentInfoDO();
|
||||||
|
BeanUtil.copyProperties(dto, hyContentInfoDO);
|
||||||
|
hyContentInfoDO.setId(Long.parseLong(dto.getContentId()));
|
||||||
|
contentInfoMapper.updateByPrimaryKeySelective(hyContentInfoDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<HyContentInfoDO> queryContentList(ContentQueryListDto dto) {
|
||||||
|
return contentInfoMapper.queryContentList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HyContentInfoDO queryContentInfo(String contentId) {
|
||||||
|
return contentInfoMapper.queryContentInfo(contentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.dto.content.ContentQueryListDto;
|
||||||
import com.cool.store.entity.HyContentInfoDO;
|
import com.cool.store.entity.HyContentInfoDO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
* @date 2023-05-29 03:50
|
* @date 2023-05-29 03:50
|
||||||
@@ -22,4 +25,22 @@ public interface HyContentInfoMapper {
|
|||||||
* dateTime:2023-05-29 03:50
|
* dateTime:2023-05-29 03:50
|
||||||
*/
|
*/
|
||||||
int updateByPrimaryKeySelective(@Param("record") HyContentInfoDO record);
|
int updateByPrimaryKeySelective(@Param("record") HyContentInfoDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除方法
|
||||||
|
* @param contentId
|
||||||
|
*/
|
||||||
|
void deleteSelective(@Param("contentId") String contentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询动态列表
|
||||||
|
* 根据传入参数匹配
|
||||||
|
*/
|
||||||
|
List<HyContentInfoDO> queryContentList(ContentQueryListDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据contentId查询动态详情
|
||||||
|
*/
|
||||||
|
HyContentInfoDO queryContentInfo(@Param("contentId") String contentId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -100,40 +100,69 @@
|
|||||||
<update id="updateByPrimaryKeySelective">
|
<update id="updateByPrimaryKeySelective">
|
||||||
update hy_content_info
|
update hy_content_info
|
||||||
<set>
|
<set>
|
||||||
<if test="record.contentTitle != null">
|
<if test="record.contentTitle != null and record.contentTitle != ''">
|
||||||
content_title = #{record.contentTitle},
|
content_title = #{record.contentTitle},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.subject != null">
|
<if test="record.subject != null and record.subject != ''">
|
||||||
subject = #{record.subject},
|
subject = #{record.subject},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.contentType != null">
|
<if test="record.contentType != null and record.contentType != ''">
|
||||||
content_type = #{record.contentType},
|
content_type = #{record.contentType},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.cover != null">
|
<if test="record.cover != null and record.cover != ''">
|
||||||
cover = #{record.cover},
|
cover = #{record.cover},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.status != null">
|
<if test="record.status != null and record.status != null">
|
||||||
status = #{record.status},
|
status = #{record.status},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.deleted != null">
|
<if test="record.deleted != null and record.deleted != ''">
|
||||||
deleted = #{record.deleted},
|
deleted = #{record.deleted},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.createTime != null">
|
<if test="record.createTime != null and record.createTime != ''">
|
||||||
create_time = #{record.createTime},
|
create_time = #{record.createTime},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.updateTime != null">
|
<if test="record.updateTime != null and record.updateTime != ''">
|
||||||
update_time = #{record.updateTime},
|
update_time = #{record.updateTime},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.createUserId != null">
|
<if test="record.createUserId != null and record.createUserId != ''">
|
||||||
create_user_id = #{record.createUserId},
|
create_user_id = #{record.createUserId},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.updateUserId != null">
|
<if test="record.updateUserId != null and record.updateUserId != ''">
|
||||||
update_user_id = #{record.updateUserId},
|
update_user_id = #{record.updateUserId},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.content != null">
|
<if test="record.content != null and record.content != ''">
|
||||||
content = #{record.content},
|
content = #{record.content},
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{record.id}
|
where id = #{record.id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="deleteSelective">
|
||||||
|
update hy_content_info
|
||||||
|
<set>
|
||||||
|
deleted = 1
|
||||||
|
</set>
|
||||||
|
where id = #{contentId}
|
||||||
|
</update>
|
||||||
|
<select id="queryContentList" resultType="com.cool.store.entity.HyContentInfoDO">
|
||||||
|
select <include refid="Base_Column_List"></include>
|
||||||
|
from hy_content_info
|
||||||
|
where deleted = 0
|
||||||
|
<if test="contentTitle != null and contentTitle != ''">
|
||||||
|
and content_title like concat('%', #{contentTitle}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="subject != null and subject != ''">
|
||||||
|
and subject = #{subject}
|
||||||
|
</if>
|
||||||
|
<if test="contentType != null and contentType != ''">
|
||||||
|
and content_type = #{contentType}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询动态详情 -->
|
||||||
|
<select id="queryContentInfo" resultType="com.cool.store.entity.HyContentInfoDO">
|
||||||
|
select <include refid="Base_Column_List"></include>
|
||||||
|
from hy_content_info
|
||||||
|
where deleted = 0
|
||||||
|
and id = #{contentId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.cool.store.dto.content;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ContentAddDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题", required = true)
|
||||||
|
private String contentTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态,0.启用1.禁用", required = true)
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "栏目code", required = true)
|
||||||
|
private String subject;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型", required = true)
|
||||||
|
private String contentType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "封面地址", required = true)
|
||||||
|
private String cover;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容(文字信息或视频地址)", required = true)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建用户id", required = true)
|
||||||
|
private String createUserId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.cool.store.dto.content;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class ContentQueryListDto extends PageBasicInfo {
|
||||||
|
|
||||||
|
@ApiModelProperty("标题")
|
||||||
|
private String contentTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty("栏目Code")
|
||||||
|
private String subject;
|
||||||
|
|
||||||
|
@ApiModelProperty("类型,默认选中全部时不传值")
|
||||||
|
private String contentType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cool.store.dto.content;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ContentUpdateDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "动态id", required = true)
|
||||||
|
private String contentId;
|
||||||
|
|
||||||
|
@ApiModelProperty("标题")
|
||||||
|
private String contentTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态,0.启用1.禁用")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty("栏目code")
|
||||||
|
private String subject;
|
||||||
|
|
||||||
|
@ApiModelProperty("类型")
|
||||||
|
private String contentType;
|
||||||
|
|
||||||
|
@ApiModelProperty("封面地址")
|
||||||
|
private String cover;
|
||||||
|
|
||||||
|
@ApiModelProperty("内容(文字信息或视频地址)")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新用户id", required = true)
|
||||||
|
private String updateUserId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
import com.cool.store.dto.content.ContentAddDto;
|
||||||
|
import com.cool.store.dto.content.ContentQueryListDto;
|
||||||
|
import com.cool.store.dto.content.ContentUpdateDto;
|
||||||
|
import com.cool.store.entity.HyContentInfoDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ContentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return contentId 新增动态id
|
||||||
|
*/
|
||||||
|
String addNews(ContentAddDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除动态
|
||||||
|
* @param contentId
|
||||||
|
*/
|
||||||
|
void deleteContent(String contentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新动态信息
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
|
void updateContent(ContentUpdateDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态列表
|
||||||
|
*/
|
||||||
|
List<HyContentInfoDO> queryContentList(ContentQueryListDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态详情
|
||||||
|
* @param contentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
HyContentInfoDO queryContentInfo(String contentId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.cool.store.dao.ContentDAO;
|
||||||
|
import com.cool.store.dto.content.ContentAddDto;
|
||||||
|
import com.cool.store.dto.content.ContentQueryListDto;
|
||||||
|
import com.cool.store.dto.content.ContentUpdateDto;
|
||||||
|
import com.cool.store.entity.HyContentInfoDO;
|
||||||
|
import com.cool.store.mapper.HyContentInfoMapper;
|
||||||
|
import com.cool.store.service.ContentService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ContentServiceImpl implements ContentService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ContentDAO contentDAO;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HyContentInfoMapper contentInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return contentId 新增动态id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addNews(ContentAddDto dto) {
|
||||||
|
HyContentInfoDO hyContentInfoDO = new HyContentInfoDO();
|
||||||
|
BeanUtil.copyProperties(dto, hyContentInfoDO);
|
||||||
|
hyContentInfoDO.setUpdateUserId(dto.getCreateUserId());
|
||||||
|
return Integer.toString(contentInfoMapper.insertSelective(hyContentInfoDO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除动态
|
||||||
|
* @param contentId
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteContent(String contentId) {
|
||||||
|
contentInfoMapper.deleteSelective(contentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新动态信息
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updateContent(ContentUpdateDto dto) {
|
||||||
|
HyContentInfoDO hyContentInfoDO = new HyContentInfoDO();
|
||||||
|
BeanUtil.copyProperties(dto, hyContentInfoDO);
|
||||||
|
hyContentInfoDO.setId(Long.parseLong(dto.getContentId()));
|
||||||
|
contentInfoMapper.updateByPrimaryKeySelective(hyContentInfoDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<HyContentInfoDO> queryContentList(ContentQueryListDto dto) {
|
||||||
|
return contentInfoMapper.queryContentList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询动态详情
|
||||||
|
* @param contentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public HyContentInfoDO queryContentInfo(String contentId) {
|
||||||
|
return contentInfoMapper.queryContentInfo(contentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -68,50 +68,51 @@ public class TokenValidateFilter implements Filter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
// HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||||
HttpServletRequest reqs = (HttpServletRequest) servletRequest;
|
// HttpServletRequest reqs = (HttpServletRequest) servletRequest;
|
||||||
String uri = reqs.getRequestURI();
|
// String uri = reqs.getRequestURI();
|
||||||
String method = reqs.getMethod();
|
// String method = reqs.getMethod();
|
||||||
String userStr = "";
|
// String userStr = "";
|
||||||
CurrentUser currentUser = null;
|
// CurrentUser currentUser = null;
|
||||||
boolean isInWhiteList = excludePath(uri);
|
// boolean isInWhiteList = excludePath(uri);
|
||||||
String accessToken = reqs.getParameter("access_token");
|
// String accessToken = reqs.getParameter("access_token");
|
||||||
String key = "access_token:" + accessToken;
|
// String key = "access_token:" + accessToken;
|
||||||
if(StringUtils.isNotBlank(accessToken)){
|
// if(StringUtils.isNotBlank(accessToken)){
|
||||||
userStr = redisUtilPool.getString(key);
|
// userStr = redisUtilPool.getString(key);
|
||||||
if(StringUtils.isNotBlank(userStr)){
|
// if(StringUtils.isNotBlank(userStr)){
|
||||||
currentUser = JSON.parseObject(userStr, CurrentUser.class);
|
// currentUser = JSON.parseObject(userStr, CurrentUser.class);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
log.info("url:{}", uri);
|
// log.info("url:{}", uri);
|
||||||
if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
// if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||||
if (StringUtils.isEmpty(accessToken)) {
|
// if (StringUtils.isEmpty(accessToken)) {
|
||||||
response.setStatus(HttpStatus.OK.value());
|
// response.setStatus(HttpStatus.OK.value());
|
||||||
response.getWriter().write(JSON.toJSONString(
|
// response.getWriter().write(JSON.toJSONString(
|
||||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
// ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (Objects.isNull(currentUser)) {
|
// if (Objects.isNull(currentUser)) {
|
||||||
response.setStatus(HttpStatus.OK.value());
|
// response.setStatus(HttpStatus.OK.value());
|
||||||
response.getWriter().write(JSON.toJSONString(
|
// response.getWriter().write(JSON.toJSONString(
|
||||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
// ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
log.info("url:{}, access_token:{}, userId:{}, username:{}, enterpriseId:{}", uri, accessToken, currentUser.getUserId(), currentUser.getName(), currentUser.getEnterpriseId());
|
// log.info("url:{}, access_token:{}, userId:{}, username:{}, enterpriseId:{}", uri, accessToken, currentUser.getUserId(), currentUser.getName(), currentUser.getEnterpriseId());
|
||||||
}
|
// }
|
||||||
if(StringUtils.isBlank(userStr) && !isInWhiteList){
|
// if(StringUtils.isBlank(userStr) && !isInWhiteList){
|
||||||
response.setStatus(HttpStatus.OK.value());
|
// response.setStatus(HttpStatus.OK.value());
|
||||||
response.getWriter().write(JSON.toJSONString(
|
// response.getWriter().write(JSON.toJSONString(
|
||||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
// ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
try {
|
// try {
|
||||||
UserContext.setUser(userStr);
|
// UserContext.setUser(userStr);
|
||||||
DataSourceHelper.changeToMy();
|
// DataSourceHelper.changeToMy();
|
||||||
filterChain.doFilter(servletRequest, servletResponse);
|
// filterChain.doFilter(servletRequest, servletResponse);
|
||||||
} finally {
|
// } finally {
|
||||||
UserContext.removeUser();
|
// UserContext.removeUser();
|
||||||
}
|
// }
|
||||||
|
filterChain.doFilter(servletRequest, servletResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.cool.store.controller;
|
||||||
|
|
||||||
|
import com.cool.store.dto.content.ContentAddDto;
|
||||||
|
import com.cool.store.dto.content.ContentQueryListDto;
|
||||||
|
import com.cool.store.dto.content.ContentUpdateDto;
|
||||||
|
import com.cool.store.entity.HyContentInfoDO;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.ContentService;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("news")
|
||||||
|
@Slf4j
|
||||||
|
public class ContentController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ContentService contentService;
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增动态")
|
||||||
|
public ResponseResult<String> addContent(@RequestBody ContentAddDto dto) {
|
||||||
|
return ResponseResult.success(contentService.addNews(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("删除动态")
|
||||||
|
public void deleteContent(@RequestParam(value = "contentId") String contentId) {
|
||||||
|
contentService.deleteContent(contentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/modify")
|
||||||
|
@ApiOperation("修改动态")
|
||||||
|
public void updateContent(@RequestBody ContentUpdateDto dto) {
|
||||||
|
contentService.updateContent(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryContentList")
|
||||||
|
@ApiOperation("查询动态列表")
|
||||||
|
public ResponseResult<PageInfo<HyContentInfoDO>> queryContentList(@RequestBody ContentQueryListDto dto) {
|
||||||
|
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||||
|
List<HyContentInfoDO> list = contentService.queryContentList(dto);
|
||||||
|
PageInfo<HyContentInfoDO> page = new PageInfo<>(list);
|
||||||
|
return ResponseResult.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/detail")
|
||||||
|
@ApiOperation("动态详情")
|
||||||
|
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestParam String contentId) {
|
||||||
|
return ResponseResult.success(contentService.queryContentInfo(contentId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user