Browse Source

在线问答

1018653686@qq.com 1 year ago
parent
commit
ad4ab09ffc
22 changed files with 793 additions and 0 deletions
  1. 0 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/a-json/TopicContentApi.json
  2. 0 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/a-json/TopicRepliesApi.json
  3. 70 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/open/OpenTopicController.java
  4. 77 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/topic/TopicContentController.java
  5. 77 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/topic/TopicRepliesController.java
  6. 17 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicContentDto.java
  7. 19 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicContentSelectDto.java
  8. 17 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicRepliesDto.java
  9. 17 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicRepliesSelectDto.java
  10. 39 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/po/TopicContent.java
  11. 31 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/po/TopicReplies.java
  12. 17 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/vo/TopicContentVo.java
  13. 17 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/vo/TopicRepliesVo.java
  14. 32 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/mapper/topic/TopicContentMapper.java
  15. 32 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/mapper/topic/TopicRepliesMapper.java
  16. 54 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/TopicContentService.java
  17. 52 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/TopicRepliesService.java
  18. 76 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/impl/TopicContentServiceImpl.java
  19. 66 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/impl/TopicRepliesServiceImpl.java
  20. 9 0
      hx-xmhjc/src/main/java/com/fjhx/xmhjc/utils/WebsiteUserUtil.java
  21. 38 0
      hx-xmhjc/src/main/resources/mapper/topic/TopicContentMapper.xml
  22. 36 0
      hx-xmhjc/src/main/resources/mapper/topic/TopicRepliesMapper.xml

File diff suppressed because it is too large
+ 0 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/a-json/TopicContentApi.json


File diff suppressed because it is too large
+ 0 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/a-json/TopicRepliesApi.json


+ 70 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/open/OpenTopicController.java

@@ -0,0 +1,70 @@
+package com.fjhx.xmhjc.controller.open;
+
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.anno.LoginValid;
+import com.fjhx.xmhjc.entity.product.vo.ProductCategoryVo;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentDto;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentSelectDto;
+import com.fjhx.xmhjc.entity.topic.dto.TopicRepliesDto;
+import com.fjhx.xmhjc.entity.topic.vo.TopicContentVo;
+import com.fjhx.xmhjc.entity.website.po.WebsiteUsers;
+import com.fjhx.xmhjc.service.topic.TopicContentService;
+import com.fjhx.xmhjc.service.topic.TopicRepliesService;
+import com.fjhx.xmhjc.service.website.WebsiteUsersService;
+import com.fjhx.xmhjc.utils.WebsiteUserUtil;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@RestController
+@RequestMapping("/open/topic")
+public class OpenTopicController {
+    @Resource
+    private TopicContentService topicContentService;
+    @Resource
+    private TopicRepliesService topicRepliesService;
+    @Resource
+    private WebsiteUsersService websiteUsersService;
+
+    @PostMapping("/contentPage")
+    public Page<TopicContentVo> categoryList(TopicContentSelectDto dto) {
+        dto.setType("1");
+        Page<TopicContentVo> page = topicContentService.contentPage(dto);
+        page.getRecords().forEach(topicContentVo -> {
+            WebsiteUsers websiteUsers = websiteUsersService.getById(topicContentVo.getAuthor());
+            topicContentVo.setAuthorName(ObjectUtil.isNull(websiteUsers) ? "匿名" : websiteUsers.getUserName());
+        });
+        return page;
+    }
+
+    @LoginValid
+    @PostMapping("/createQuestion")
+    public void categoryList(@RequestBody TopicContentDto topicContentDto) {
+        if (StrUtil.isBlank(topicContentDto.getTitle())) {
+            throw new RuntimeException("标题不能为空");
+        }
+        if (StrUtil.isBlank(topicContentDto.getContent())) {
+            throw new RuntimeException("内容不能为空");
+        }
+        topicContentDto.setType("1");
+        WebsiteUsers loginWebsiteUser = WebsiteUserUtil.getLoginWebsiteUser();
+        topicContentDto.setAuthor(loginWebsiteUser.getId());
+        topicContentService.add(topicContentDto);
+    }
+
+    @LoginValid
+    @PostMapping("/reply/{topicId}")
+    public void categoryList(@RequestBody TopicRepliesDto topicRepliesDto, @PathVariable Long topicId) {
+        if (StrUtil.isBlank(topicRepliesDto.getContent())) {
+            throw new RuntimeException("回复不能为空");
+        }
+        topicRepliesDto.setTopicId(topicId);
+        WebsiteUsers loginWebsiteUser = WebsiteUserUtil.getLoginWebsiteUser();
+        topicRepliesDto.setAuthor(loginWebsiteUser.getId());
+        topicRepliesService.add(topicRepliesDto);
+    }
+}

+ 77 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/topic/TopicContentController.java

@@ -0,0 +1,77 @@
+package com.fjhx.xmhjc.controller.topic;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicContentVo;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentSelectDto;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.xmhjc.service.topic.TopicContentService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 内容主题 前端控制器
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@RestController
+@RequestMapping("/topicContent")
+public class TopicContentController {
+
+    @Autowired
+    private TopicContentService topicContentService;
+
+    /**
+     * 内容主题列表
+     */
+    @PostMapping("/list")
+    public List<TopicContentVo> list(@RequestBody TopicContentSelectDto dto) {
+        return topicContentService.getList(dto);
+    }
+
+    /**
+     * 内容主题分页
+     */
+    @PostMapping("/page")
+    public Page<TopicContentVo> page(@RequestBody TopicContentSelectDto dto) {
+        return topicContentService.getPage(dto);
+    }
+
+    /**
+     * 内容主题明细
+     */
+    @PostMapping("/detail")
+    public TopicContentVo detail(@RequestBody BaseSelectDto dto) {
+        return topicContentService.detail(dto.getId());
+    }
+
+    /**
+     * 内容主题新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody TopicContentDto topicContentDto) {
+        topicContentService.add(topicContentDto);
+    }
+
+    /**
+     * 内容主题编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody TopicContentDto topicContentDto) {
+        topicContentService.edit(topicContentDto);
+    }
+
+    /**
+     * 内容主题删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        topicContentService.delete(dto.getId());
+    }
+
+}

+ 77 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/controller/topic/TopicRepliesController.java

@@ -0,0 +1,77 @@
+package com.fjhx.xmhjc.controller.topic;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicRepliesVo;
+import com.fjhx.xmhjc.entity.topic.dto.TopicRepliesSelectDto;
+import com.fjhx.xmhjc.entity.topic.dto.TopicRepliesDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.xmhjc.service.topic.TopicRepliesService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 主题回复 前端控制器
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@RestController
+@RequestMapping("/topicReplies")
+public class TopicRepliesController {
+
+    @Autowired
+    private TopicRepliesService topicRepliesService;
+
+    /**
+     * 主题回复列表
+     */
+    @PostMapping("/list")
+    public List<TopicRepliesVo> list(@RequestBody TopicRepliesSelectDto dto) {
+        return topicRepliesService.getList(dto);
+    }
+
+    /**
+     * 主题回复分页
+     */
+    @PostMapping("/page")
+    public Page<TopicRepliesVo> page(@RequestBody TopicRepliesSelectDto dto) {
+        return topicRepliesService.getPage(dto);
+    }
+
+    /**
+     * 主题回复明细
+     */
+    @PostMapping("/detail")
+    public TopicRepliesVo detail(@RequestBody BaseSelectDto dto) {
+        return topicRepliesService.detail(dto.getId());
+    }
+
+    /**
+     * 主题回复新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody TopicRepliesDto topicRepliesDto) {
+        topicRepliesService.add(topicRepliesDto);
+    }
+
+    /**
+     * 主题回复编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody TopicRepliesDto topicRepliesDto) {
+        topicRepliesService.edit(topicRepliesDto);
+    }
+
+    /**
+     * 主题回复删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        topicRepliesService.delete(dto.getId());
+    }
+
+}

+ 17 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicContentDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.xmhjc.entity.topic.dto;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicContent;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 内容主题新增编辑入参实体
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+public class TopicContentDto extends TopicContent {
+
+}

+ 19 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicContentSelectDto.java

@@ -0,0 +1,19 @@
+package com.fjhx.xmhjc.entity.topic.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 内容主题列表查询入参实体
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+public class TopicContentSelectDto extends BaseSelectDto {
+    private String title;
+    private String type;
+    private String toping;
+}

+ 17 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicRepliesDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.xmhjc.entity.topic.dto;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicReplies;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 主题回复新增编辑入参实体
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+public class TopicRepliesDto extends TopicReplies {
+
+}

+ 17 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/dto/TopicRepliesSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.xmhjc.entity.topic.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 主题回复列表查询入参实体
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+public class TopicRepliesSelectDto extends BaseSelectDto {
+
+}

+ 39 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/po/TopicContent.java

@@ -0,0 +1,39 @@
+package com.fjhx.xmhjc.entity.topic.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 内容主题
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+@TableName("topic_content")
+public class TopicContent extends BasePo {
+
+    private String title;
+
+    /**
+     * 概要
+     */
+    private String outline;
+
+    private String type;
+
+    /**
+     * 是否置顶
+     */
+    private String toping;
+    private String content;
+
+    private Long author;
+
+}

+ 31 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/po/TopicReplies.java

@@ -0,0 +1,31 @@
+package com.fjhx.xmhjc.entity.topic.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 主题回复
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+@TableName("topic_replies")
+public class TopicReplies extends BasePo {
+
+    private Long topicId;
+
+    private String content;
+
+    private Long floorId;
+
+    private Long replyId;
+
+    private Long author;
+}

+ 17 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/vo/TopicContentVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.xmhjc.entity.topic.vo;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicContent;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 内容主题列表查询返回值实体
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+public class TopicContentVo extends TopicContent {
+    private String authorName;
+}

+ 17 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/topic/vo/TopicRepliesVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.xmhjc.entity.topic.vo;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicReplies;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 主题回复列表查询返回值实体
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Getter
+@Setter
+public class TopicRepliesVo extends TopicReplies {
+
+}

+ 32 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/mapper/topic/TopicContentMapper.java

@@ -0,0 +1,32 @@
+package com.fjhx.xmhjc.mapper.topic;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicContent;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicContentVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 内容主题 Mapper 接口
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+public interface TopicContentMapper extends BaseMapper<TopicContent> {
+
+    /**
+     * 内容主题列表
+     */
+    List<TopicContentVo> getList(@Param("ew") IWrapper<TopicContent> wrapper);
+
+    /**
+     * 内容主题分页
+     */
+    Page<TopicContentVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<TopicContent> wrapper);
+
+}

+ 32 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/mapper/topic/TopicRepliesMapper.java

@@ -0,0 +1,32 @@
+package com.fjhx.xmhjc.mapper.topic;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicReplies;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicRepliesVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 主题回复 Mapper 接口
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+public interface TopicRepliesMapper extends BaseMapper<TopicReplies> {
+
+    /**
+     * 主题回复列表
+     */
+    List<TopicRepliesVo> getList(@Param("ew") IWrapper<TopicReplies> wrapper);
+
+    /**
+     * 主题回复分页
+     */
+    Page<TopicRepliesVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<TopicReplies> wrapper);
+
+}

+ 54 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/TopicContentService.java

@@ -0,0 +1,54 @@
+package com.fjhx.xmhjc.service.topic;
+
+import com.fjhx.xmhjc.entity.product.vo.ProductCategoryVo;
+import com.fjhx.xmhjc.entity.topic.po.TopicContent;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicContentVo;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentSelectDto;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentDto;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 内容主题 服务类
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+public interface TopicContentService extends BaseService<TopicContent> {
+
+    /**
+     * 内容主题列表
+     */
+    List<TopicContentVo> getList(TopicContentSelectDto dto);
+
+    /**
+     * 内容主题分页
+     */
+    Page<TopicContentVo> getPage(TopicContentSelectDto dto);
+
+    /**
+     * 内容主题明细
+     */
+    TopicContentVo detail(Long id);
+
+    /**
+     * 内容主题新增
+     */
+    void add(TopicContentDto topicContentDto);
+
+    /**
+     * 内容主题编辑
+     */
+    void edit(TopicContentDto topicContentDto);
+
+    /**
+     * 内容主题删除
+     */
+    void delete(Long id);
+
+    Page<TopicContentVo> contentPage(TopicContentSelectDto dto);
+}

+ 52 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/TopicRepliesService.java

@@ -0,0 +1,52 @@
+package com.fjhx.xmhjc.service.topic;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicReplies;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicRepliesVo;
+import com.fjhx.xmhjc.entity.topic.dto.TopicRepliesSelectDto;
+import com.fjhx.xmhjc.entity.topic.dto.TopicRepliesDto;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 主题回复 服务类
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+public interface TopicRepliesService extends BaseService<TopicReplies> {
+
+    /**
+     * 主题回复列表
+     */
+    List<TopicRepliesVo> getList(TopicRepliesSelectDto dto);
+
+    /**
+     * 主题回复分页
+     */
+    Page<TopicRepliesVo> getPage(TopicRepliesSelectDto dto);
+
+    /**
+     * 主题回复明细
+     */
+    TopicRepliesVo detail(Long id);
+
+    /**
+     * 主题回复新增
+     */
+    void add(TopicRepliesDto topicRepliesDto);
+
+    /**
+     * 主题回复编辑
+     */
+    void edit(TopicRepliesDto topicRepliesDto);
+
+    /**
+     * 主题回复删除
+     */
+    void delete(Long id);
+
+}

+ 76 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/impl/TopicContentServiceImpl.java

@@ -0,0 +1,76 @@
+package com.fjhx.xmhjc.service.topic.impl;
+
+import com.fjhx.xmhjc.entity.product.vo.ProductCategoryVo;
+import com.fjhx.xmhjc.entity.topic.po.TopicContent;
+import com.fjhx.xmhjc.mapper.topic.TopicContentMapper;
+import com.fjhx.xmhjc.service.topic.TopicContentService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicContentVo;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.xmhjc.entity.topic.dto.TopicContentDto;
+import cn.hutool.core.bean.BeanUtil;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 内容主题 服务实现类
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Service
+public class TopicContentServiceImpl extends ServiceImpl<TopicContentMapper, TopicContent> implements TopicContentService {
+
+    @Override
+    public List<TopicContentVo> getList(TopicContentSelectDto dto) {
+        IWrapper<TopicContent> wrapper = getWrapper();
+        wrapper.orderByDesc("tc", TopicContent::getId);
+        List<TopicContentVo> list = this.baseMapper.getList(wrapper);
+        return list;
+    }
+
+    @Override
+    public Page<TopicContentVo> getPage(TopicContentSelectDto dto) {
+        IWrapper<TopicContent> wrapper = getWrapper();
+        wrapper.orderByDesc("tc", TopicContent::getId);
+        Page<TopicContentVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public TopicContentVo detail(Long id) {
+        TopicContent TopicContent = this.getById(id);
+        TopicContentVo result = BeanUtil.toBean(TopicContent, TopicContentVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(TopicContentDto topicContentDto) {
+        this.save(topicContentDto);
+    }
+
+    @Override
+    public void edit(TopicContentDto topicContentDto) {
+        this.updateById(topicContentDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+
+    @Override
+    public Page<TopicContentVo> contentPage(TopicContentSelectDto dto) {
+        IWrapper<TopicContent> wrapper = getWrapper();
+        wrapper.orderByDesc("tc", TopicContent::getToping);
+        wrapper.orderByDesc("tc", TopicContent::getId);
+        Page<TopicContentVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+}

+ 66 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/topic/impl/TopicRepliesServiceImpl.java

@@ -0,0 +1,66 @@
+package com.fjhx.xmhjc.service.topic.impl;
+
+import com.fjhx.xmhjc.entity.topic.po.TopicReplies;
+import com.fjhx.xmhjc.mapper.topic.TopicRepliesMapper;
+import com.fjhx.xmhjc.service.topic.TopicRepliesService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.xmhjc.entity.topic.vo.TopicRepliesVo;
+import com.fjhx.xmhjc.entity.topic.dto.TopicRepliesSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.xmhjc.entity.topic.dto.TopicRepliesDto;
+import cn.hutool.core.bean.BeanUtil;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 主题回复 服务实现类
+ * </p>
+ *
+ * @author hj
+ * @since 2023-11-20
+ */
+@Service
+public class TopicRepliesServiceImpl extends ServiceImpl<TopicRepliesMapper, TopicReplies> implements TopicRepliesService {
+
+    @Override
+    public List<TopicRepliesVo> getList(TopicRepliesSelectDto dto) {
+        IWrapper<TopicReplies> wrapper = getWrapper();
+        wrapper.orderByDesc("tr", TopicReplies::getId);
+        List<TopicRepliesVo> list = this.baseMapper.getList(wrapper);
+        return list;
+    }
+
+    @Override
+    public Page<TopicRepliesVo> getPage(TopicRepliesSelectDto dto) {
+        IWrapper<TopicReplies> wrapper = getWrapper();
+        wrapper.orderByDesc("tr", TopicReplies::getId);
+        Page<TopicRepliesVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public TopicRepliesVo detail(Long id) {
+        TopicReplies TopicReplies = this.getById(id);
+        TopicRepliesVo result = BeanUtil.toBean(TopicReplies, TopicRepliesVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(TopicRepliesDto topicRepliesDto) {
+        this.save(topicRepliesDto);
+    }
+
+    @Override
+    public void edit(TopicRepliesDto topicRepliesDto) {
+        this.updateById(topicRepliesDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 9 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/utils/WebsiteUserUtil.java

@@ -1,6 +1,7 @@
 package com.fjhx.xmhjc.utils;
 
 import com.fjhx.xmhjc.constants.LoginConstant;
+import com.fjhx.xmhjc.entity.website.po.WebsiteUsers;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
@@ -10,8 +11,16 @@ import com.ruoyi.common.utils.spring.SpringUtils;
  * @date 2023111710:31
  */
 public class WebsiteUserUtil {
+    private static RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
+
     public static String getWebsiteUserToken() {
         String token = ServletUtils.getRequest().getHeader(LoginConstant.LONGIN_HEAD);
         return token;
     }
+
+
+    public static WebsiteUsers getLoginWebsiteUser() {
+        WebsiteUsers websiteUsers = redisCache.getCacheObject(LoginConstant.TOKEN_PREFIX+getWebsiteUserToken());
+        return websiteUsers;
+    }
 }

+ 38 - 0
hx-xmhjc/src/main/resources/mapper/topic/TopicContentMapper.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.xmhjc.mapper.topic.TopicContentMapper">
+    <select id="getList" resultType="com.fjhx.xmhjc.entity.topic.vo.TopicContentVo">
+        select
+            tc.id,
+            tc.title,
+            tc.outline,
+            tc.type,
+            tc.create_user,
+            tc.create_time,
+            tc.update_user,
+            tc.update_time,
+            tc.toping,
+            tc.content,
+            tc.author
+        from topic_content tc
+            ${ew.customSqlSegment}
+    </select>
+
+    <select id="getPage" resultType="com.fjhx.xmhjc.entity.topic.vo.TopicContentVo">
+        select
+            tc.id,
+            tc.title,
+            tc.outline,
+            tc.type,
+            tc.create_user,
+            tc.create_time,
+            tc.update_user,
+            tc.update_time,
+            tc.toping,
+            tc.content,
+            tc.author
+        from topic_content tc
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 36 - 0
hx-xmhjc/src/main/resources/mapper/topic/TopicRepliesMapper.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.xmhjc.mapper.topic.TopicRepliesMapper">
+    <select id="getList" resultType="com.fjhx.xmhjc.entity.topic.vo.TopicRepliesVo">
+        select
+            tr.id,
+            tr.topic_id,
+            tr.content,
+            tr.floor_id,
+            tr.reply_id,
+            tr.create_user,
+            tr.create_time,
+            tr.update_user,
+            tr.update_time,
+            tr.author
+        from topic_replies tr
+            ${ew.customSqlSegment}
+    </select>
+
+    <select id="getPage" resultType="com.fjhx.xmhjc.entity.topic.vo.TopicRepliesVo">
+        select
+            tr.id,
+            tr.topic_id,
+            tr.content,
+            tr.floor_id,
+            tr.reply_id,
+            tr.create_user,
+            tr.create_time,
+            tr.update_user,
+            tr.update_time,
+            tr.author
+        from topic_replies tr
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

Some files were not shown because too many files changed in this diff