Browse Source

在线问答

1018653686@qq.com 1 year ago
parent
commit
59fd4421f8

+ 2 - 3
hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/open/OpenTopicController.java

@@ -45,7 +45,7 @@ public class OpenTopicController {
      * @date 2023/11/23 22:29
      */
     @PostMapping("/contentPage/{sortType}")
-    public Page<TopicContentVo> contentPage(TopicContentSelectDto dto, @PathVariable String sortType) {
+    public Page<TopicContentVo> contentPage(@RequestBody TopicContentSelectDto dto, @PathVariable String sortType) {
         dto.setType("1");
         Page<TopicContentVo> page = topicContentService.contentPage(dto, sortType);
         page.getRecords().forEach(topicContentVo -> {
@@ -121,7 +121,7 @@ public class OpenTopicController {
      * @date 2023/11/23 22:30
      */
     @PostMapping("/detail/{topicId}")
-    public OpenTopicContentVO detail(@PathVariable Long topicId,@RequestBody TopicRepliesDto topicRepliesDto) {
+    public OpenTopicContentVO detail(@PathVariable Long topicId,@RequestBody TopicRepliesSelectDto dto) {
         TopicContent topicContent = topicContentService.getById(topicId);
         if (ObjectUtil.isNull(topicContent)) {
             throw new RuntimeException("主题不存在");
@@ -132,7 +132,6 @@ public class OpenTopicController {
         OpenTopicContentVO openTopicContentVO = BeanUtil.copyProperties(topicContent, OpenTopicContentVO.class);
         openTopicContentVO.setAuthorName(websiteUsersService.getAuthorName(topicContent.getAuthor()));
         //分页查出楼层回复
-        TopicRepliesSelectDto dto = new TopicRepliesSelectDto();
         dto.setTopicId(topicId);
         Page<TopicRepliesVo> page = topicRepliesService.getPageByOpen(dto);
         List<TopicRepliesVo> records = page.getRecords();