提交 6c7d2d66 作者: xiaowang

动态审核及列表展示创建时间

上级 d8d3c9b1
......@@ -8,11 +8,11 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* @Author LW
*
* @date 2023/6/19 14:25 概要:
*/
@Data
......@@ -37,4 +37,8 @@ public class DynamicInfoDTO {
@ApiModelProperty(value = "用户id")
private Integer userAccountId;
@ApiModelProperty(value = "动态发布时间")
private Date dynamicPublishTime;
}
......@@ -16,7 +16,6 @@ import javax.servlet.http.HttpServletRequest;
/**
* @Author LW
*
* @date 2023/6/19 10:44 概要:
*/
@Api(tags = {"后台-论坛管理-模块"})
......@@ -24,7 +23,8 @@ import javax.servlet.http.HttpServletRequest;
@RequestMapping("/backstage/forum")
public class BackstageForumController {
@Autowired BackstageForumService backstageForumService;
@Autowired
BackstageForumService backstageForumService;
@ApiOperation(value = "后台-动态列表")
@PostMapping("/listDynamic")
......@@ -54,4 +54,11 @@ public class BackstageForumController {
public ResultBody likeUserInfo(@RequestParam Integer dynamicId, HttpServletRequest request) {
return backstageForumService.likeUserInfo(dynamicId, request);
}
@ApiOperation(value = "审核动态")
@GetMapping("/checkDynamic")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody checkDynamic(@RequestParam Integer dynamicId, @RequestParam Boolean status) {
return backstageForumService.checkDynamic(dynamicId, status);
}
}
......@@ -144,4 +144,6 @@ public interface DynamicDAO {
ForumDynamicDO getDynamicInfoById(Integer dynamicId);
List<ForumDynamicDO> firstTwoItemsComment(List<Integer> ids);
void updateCheckDynamic(Integer dynamicId, Integer status);
}
......@@ -88,6 +88,7 @@ public class ForumDynamicDO extends BaseDO implements Serializable {
.id(this.getId())
.userAccountId(userAccountId)
.description(description)
.dynamicPublishTime(this.getCreateTime())
.show(this.getDeleted())
.build();
}
......
......@@ -8,7 +8,6 @@ import javax.servlet.http.HttpServletRequest;
/**
* @Author LW
*
* @date 2023/6/19 10:47 概要:
*/
public interface BackstageForumService {
......@@ -19,4 +18,7 @@ public interface BackstageForumService {
ResultBody hiddenDynamic(Integer dynamicId);
ResultBody likeUserInfo(Integer dynamicId, HttpServletRequest request);
ResultBody checkDynamic(Integer dynamicId, Boolean status);
}
......@@ -30,15 +30,18 @@ import java.util.stream.Collectors;
/**
* @Author LW
*
* @date 2023/6/19 10:47 概要:
*/
@Service
public class BackstageForumServiceImpl implements BackstageForumService {
@Autowired BackstageForumDao backstageForumDao;
@Autowired DynamicDAO dynamicDAO;
@Autowired UserAppApi userAppApi;
@Autowired LikeDAO likeDAO;
@Autowired
BackstageForumDao backstageForumDao;
@Autowired
DynamicDAO dynamicDAO;
@Autowired
UserAppApi userAppApi;
@Autowired
LikeDAO likeDAO;
@Override
public PageResult listDynamic(DynamicQO dynamic, HttpServletRequest request) {
......@@ -152,4 +155,15 @@ public class BackstageForumServiceImpl implements BackstageForumService {
}
return ResultBody.success();
}
@Override
public ResultBody checkDynamic(Integer dynamicId, Boolean status) {
if (status) {
dynamicDAO.updateCheckDynamic(dynamicId, 1);
} else {
dynamicDAO.updateCheckDynamic(dynamicId, 2);
}
return ResultBody.success();
}
}
......@@ -17,7 +17,7 @@
</where>
</select>
<select id="listDynamicInfo" resultType="com.mmc.csf.release.entity.forum.ForumDynamicDO">
select id,user_account_id,description,is_deleted as deleted from forum_dynamic
select id,user_account_id,description,is_deleted as deleted,create_time from forum_dynamic
<where>
root_path is null
<if test="ids != null">
......
......@@ -51,6 +51,11 @@
end
where id = #{dynamicId}
</update>
<update id="updateCheckDynamic">
update forum_dynamic
set check_status = #{status}
where id = #{dynamicId}
</update>
<delete id="deleteDynamic">
delete
from forum_dynamic
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论