Przeglądaj źródła

物业管理端评论

tjf 4 miesięcy temu
rodzic
commit
a47d53100f
31 zmienionych plików z 3067 dodań i 3 usunięć
  1. 91 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentContentController.java
  2. 101 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentIndexController.java
  3. 91 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentLikesController.java
  4. 91 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentStarsController.java
  5. 139 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentContent.java
  6. 223 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentIndex.java
  7. 125 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentLikes.java
  8. 125 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentStars.java
  9. 85 1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommunityNews.java
  10. 136 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/CommentChildrenVo.java
  11. 147 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/CommentIndexVo.java
  12. 76 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/CommentUserVo.java
  13. 74 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/TargetUserVo.java
  14. 77 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentContentMapper.java
  15. 73 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentIndexMapper.java
  16. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentLikesMapper.java
  17. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentStarsMapper.java
  18. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentContentService.java
  19. 71 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentIndexService.java
  20. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentLikesService.java
  21. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentStarsService.java
  22. 97 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentContentServiceImpl.java
  23. 146 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentIndexServiceImpl.java
  24. 97 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentLikesServiceImpl.java
  25. 97 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentStarsServiceImpl.java
  26. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommunityAssetsServiceImpl.java
  27. 113 0
      ruoyi-system/src/main/resources/mapper/system/CommentContentMapper.xml
  28. 247 0
      ruoyi-system/src/main/resources/mapper/system/CommentIndexMapper.xml
  29. 100 0
      ruoyi-system/src/main/resources/mapper/system/CommentLikesMapper.xml
  30. 100 0
      ruoyi-system/src/main/resources/mapper/system/CommentStarsMapper.xml
  31. 31 1
      ruoyi-system/src/main/resources/mapper/system/CommunityNewsMapper.xml

+ 91 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentContentController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.communityNews;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.communityNews.CommentContent;
+import com.ruoyi.system.service.ICommentContentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 社区资讯评论内容Controller
+ *
+ * @author boman
+ * @date 2025-02-25
+ */
+@RestController
+@RequestMapping("/wuYe/commentContent")
+public class CommentContentController extends BaseController {
+    @Autowired
+    private ICommentContentService commentContentService;
+
+    /**
+     * 查询社区资讯评论内容列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentContent:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CommentContent commentContent) {
+        startPage();
+        List<CommentContent> list = commentContentService.selectCommentContentList(commentContent);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出社区资讯评论内容列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentContent:export')")
+    @Log(title = "社区资讯评论内容", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CommentContent commentContent) {
+        List<CommentContent> list = commentContentService.selectCommentContentList(commentContent);
+        ExcelUtil<CommentContent> util = new ExcelUtil<CommentContent>(CommentContent.class);
+        util.exportExcel(response, list, "社区资讯评论内容数据");
+    }
+
+    /**
+     * 获取社区资讯评论内容详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentContent:query')")
+    @GetMapping(value = "/{contentId}")
+    public AjaxResult getInfo(@PathVariable("contentId") Long contentId) {
+        return success(commentContentService.selectCommentContentByContentId(contentId));
+    }
+
+    /**
+     * 新增社区资讯评论内容
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentContent:add')")
+    @Log(title = "社区资讯评论内容", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CommentContent commentContent) {
+        return toAjax(commentContentService.insertCommentContent(commentContent));
+    }
+
+    /**
+     * 修改社区资讯评论内容
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentContent:edit')")
+    @Log(title = "社区资讯评论内容", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody CommentContent commentContent) {
+        return toAjax(commentContentService.updateCommentContent(commentContent));
+    }
+
+    /**
+     * 删除社区资讯评论内容
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentContent:remove')")
+    @Log(title = "社区资讯评论内容", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{contentIds}")
+    public AjaxResult remove(@PathVariable Long[] contentIds) {
+        return toAjax(commentContentService.deleteCommentContentByContentIds(contentIds));
+    }
+}

+ 101 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentIndexController.java

@@ -0,0 +1,101 @@
+package com.ruoyi.web.controller.communityNews;
+
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.communityNews.CommentIndex;
+import com.ruoyi.system.service.ICommentIndexService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 社区资讯评论Controller
+ *
+ * @author boman
+ * @date 2025-02-25
+ */
+@RestController
+@RequestMapping("/wuYe/commentIndex")
+public class CommentIndexController extends BaseController {
+    @Autowired
+    private ICommentIndexService commentIndexService;
+
+    /**
+     * 查询社区资讯评论列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentIndex:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CommentIndex commentIndex) {
+        startPage();
+        List<CommentIndex> list = commentIndexService.selectCommentIndexList(commentIndex);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出社区资讯评论列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentIndex:export')")
+    @Log(title = "社区资讯评论", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CommentIndex commentIndex) {
+        List<CommentIndex> list = commentIndexService.selectCommentIndexList(commentIndex);
+        ExcelUtil<CommentIndex> util = new ExcelUtil<CommentIndex>(CommentIndex.class);
+        util.exportExcel(response, list, "社区资讯评论数据");
+    }
+
+    /**
+     * 查询所有评论组装成前端所需要的数据结构
+     */
+    @Anonymous
+    @PostMapping(value = "/getRootComment", name = "查询一级评论")
+    public AjaxResult getRootComment(CommentIndex commentIndex) {
+        return commentIndexService.getAllComment(commentIndex);
+    }
+
+    /**
+     * 获取社区资讯评论详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentIndex:query')")
+    @GetMapping(value = "/{commentId}")
+    public AjaxResult getInfo(@PathVariable("commentId") Long commentId) {
+        return success(commentIndexService.selectCommentIndexByCommentId(commentId));
+    }
+
+    /**
+     * 新增社区资讯评论
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentIndex:add')")
+    @Log(title = "社区资讯评论", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CommentIndex commentIndex) {
+        return toAjax(commentIndexService.insertCommentIndex(commentIndex));
+    }
+
+    /**
+     * 修改社区资讯评论
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentIndex:edit')")
+    @Log(title = "社区资讯评论", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody CommentIndex commentIndex) {
+        return toAjax(commentIndexService.updateCommentIndex(commentIndex));
+    }
+
+    /**
+     * 删除社区资讯评论
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentIndex:remove')")
+    @Log(title = "社区资讯评论", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{commentIds}")
+    public AjaxResult remove(@PathVariable Long[] commentIds) {
+        return toAjax(commentIndexService.deleteCommentIndexByCommentIds(commentIds));
+    }
+}

+ 91 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentLikesController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.communityNews;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.communityNews.CommentLikes;
+import com.ruoyi.system.service.ICommentLikesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 社区资讯点赞Controller
+ *
+ * @author boman
+ * @date 2025-02-25
+ */
+@RestController
+@RequestMapping("/wuYe/commentLikes")
+public class CommentLikesController extends BaseController {
+    @Autowired
+    private ICommentLikesService commentLikesService;
+
+    /**
+     * 查询社区资讯点赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentLikes:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CommentLikes commentLikes) {
+        startPage();
+        List<CommentLikes> list = commentLikesService.selectCommentLikesList(commentLikes);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出社区资讯点赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentLikes:export')")
+    @Log(title = "社区资讯点赞", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CommentLikes commentLikes) {
+        List<CommentLikes> list = commentLikesService.selectCommentLikesList(commentLikes);
+        ExcelUtil<CommentLikes> util = new ExcelUtil<CommentLikes>(CommentLikes.class);
+        util.exportExcel(response, list, "社区资讯点赞数据");
+    }
+
+    /**
+     * 获取社区资讯点赞详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentLikes:query')")
+    @GetMapping(value = "/{likesId}")
+    public AjaxResult getInfo(@PathVariable("likesId") Long likesId) {
+        return success(commentLikesService.selectCommentLikesByLikesId(likesId));
+    }
+
+    /**
+     * 新增社区资讯点赞
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentLikes:add')")
+    @Log(title = "社区资讯点赞", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CommentLikes commentLikes) {
+        return toAjax(commentLikesService.insertCommentLikes(commentLikes));
+    }
+
+    /**
+     * 修改社区资讯点赞
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentLikes:edit')")
+    @Log(title = "社区资讯点赞", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody CommentLikes commentLikes) {
+        return toAjax(commentLikesService.updateCommentLikes(commentLikes));
+    }
+
+    /**
+     * 删除社区资讯点赞
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentLikes:remove')")
+    @Log(title = "社区资讯点赞", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{likesIds}")
+    public AjaxResult remove(@PathVariable Long[] likesIds) {
+        return toAjax(commentLikesService.deleteCommentLikesByLikesIds(likesIds));
+    }
+}

+ 91 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/communityNews/CommentStarsController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.communityNews;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.communityNews.CommentStars;
+import com.ruoyi.system.service.ICommentStarsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 社区资讯收藏Controller
+ *
+ * @author boman
+ * @date 2025-02-25
+ */
+@RestController
+@RequestMapping("/wuYe/commentStars")
+public class CommentStarsController extends BaseController {
+    @Autowired
+    private ICommentStarsService commentStarsService;
+
+    /**
+     * 查询社区资讯收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentStars:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CommentStars commentStars) {
+        startPage();
+        List<CommentStars> list = commentStarsService.selectCommentStarsList(commentStars);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出社区资讯收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentStars:export')")
+    @Log(title = "社区资讯收藏", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CommentStars commentStars) {
+        List<CommentStars> list = commentStarsService.selectCommentStarsList(commentStars);
+        ExcelUtil<CommentStars> util = new ExcelUtil<CommentStars>(CommentStars.class);
+        util.exportExcel(response, list, "社区资讯收藏数据");
+    }
+
+    /**
+     * 获取社区资讯收藏详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentStars:query')")
+    @GetMapping(value = "/{starsId}")
+    public AjaxResult getInfo(@PathVariable("starsId") Long starsId) {
+        return success(commentStarsService.selectCommentStarsByStarsId(starsId));
+    }
+
+    /**
+     * 新增社区资讯收藏
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentStars:add')")
+    @Log(title = "社区资讯收藏", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CommentStars commentStars) {
+        return toAjax(commentStarsService.insertCommentStars(commentStars));
+    }
+
+    /**
+     * 修改社区资讯收藏
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentStars:edit')")
+    @Log(title = "社区资讯收藏", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody CommentStars commentStars) {
+        return toAjax(commentStarsService.updateCommentStars(commentStars));
+    }
+
+    /**
+     * 删除社区资讯收藏
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:commentStars:remove')")
+    @Log(title = "社区资讯收藏", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{starsIds}")
+    public AjaxResult remove(@PathVariable Long[] starsIds) {
+        return toAjax(commentStarsService.deleteCommentStarsByStarsIds(starsIds));
+    }
+}

+ 139 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentContent.java

@@ -0,0 +1,139 @@
+package com.ruoyi.system.domain.communityNews;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 社区资讯评论内容对象 comment_content
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public class CommentContent extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 内容主键 */
+    private Long contentId;
+
+    /** 评论id 无用*/
+    @Excel(name = "评论id")
+    private Long commentId;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 评论内容 */
+    @Excel(name = "评论内容")
+    private String commentContent;
+
+    /** 状态:1:待审核 2:审核通过 3:审核不通过 4:审核通过后下架 */
+    @Excel(name = "状态:1:待审核 2:审核通过 3:审核不通过 4:审核通过后下架")
+    private Integer status;
+
+    /** 类型:1:文字 2:图片 */
+    @Excel(name = "类型:1:文字 2:图片")
+    private Integer type;
+
+    /** 点赞数量 */
+    @Excel(name = "点赞数量")
+    private Long likeCount;
+
+    /** 逻辑删除(Y:已删除,N:未删除) */
+    private String delFlag;
+
+    public void setContentId(Long contentId) 
+    {
+        this.contentId = contentId;
+    }
+
+    public Long getContentId() 
+    {
+        return contentId;
+    }
+    public void setCommentId(Long commentId) 
+    {
+        this.commentId = commentId;
+    }
+
+    public Long getCommentId() 
+    {
+        return commentId;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setCommentContent(String commentContent) 
+    {
+        this.commentContent = commentContent;
+    }
+
+    public String getCommentContent() 
+    {
+        return commentContent;
+    }
+    public void setStatus(Integer status) 
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus() 
+    {
+        return status;
+    }
+    public void setType(Integer type) 
+    {
+        this.type = type;
+    }
+
+    public Integer getType() 
+    {
+        return type;
+    }
+    public void setLikeCount(Long likeCount) 
+    {
+        this.likeCount = likeCount;
+    }
+
+    public Long getLikeCount() 
+    {
+        return likeCount;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("contentId", getContentId())
+            .append("commentId", getCommentId())
+            .append("userId", getUserId())
+            .append("commentContent", getCommentContent())
+            .append("status", getStatus())
+            .append("type", getType())
+            .append("likeCount", getLikeCount())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 223 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentIndex.java

@@ -0,0 +1,223 @@
+package com.ruoyi.system.domain.communityNews;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 社区资讯评论对象 comment_index
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public class CommentIndex extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 社区资讯评论ID */
+    private Long commentId;
+
+    /** 社区资讯ID */
+    @Excel(name = "社区资讯ID")
+    private Long communityId;
+
+    /** 社区资讯类型(1:公告 2:通知 3:资讯) */
+    @Excel(name = "社区资讯类型", readConverterExp = "1=:公告,2=:通知,3=:资讯")
+    private String communityType;
+
+    /** 根评论id 1:根评论 2:子评论 */
+    @Excel(name = "根评论id 1:根评论 2:子评论")
+    private Integer isRoot;
+
+    /** 父评论id */
+    @Excel(name = "父评论id")
+    private Long parentId;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 用户昵称 */
+    @Excel(name = "用户昵称")
+    private String nickName;
+
+    /** 头像地址 */
+    @Excel(name = "头像地址")
+    private String avatar;
+
+    /** 所回复目标评论的用户id */
+    @Excel(name = "所回复目标评论的用户id")
+    private Long toUserId;
+
+    /** 所回复目标评论的用户昵称 */
+    @Excel(name = "所回复目标评论的用户昵称")
+    private String toNickName;
+
+    /** 所回复目标评论的头像地址 */
+    @Excel(name = "所回复目标评论的头像地址")
+    private String toAvatar;
+
+    /** 内容id */
+    @Excel(name = "内容id")
+    private Long contentId;
+
+    /** 评论内容(冗余字段) */
+    @Excel(name = "评论内容(冗余字段)")
+    private String commentContent;
+
+    /** 逻辑删除(Y:已删除,N:未删除) */
+    private String delFlag;
+
+    public void setCommentId(Long commentId) 
+    {
+        this.commentId = commentId;
+    }
+
+    public Long getCommentId() 
+    {
+        return commentId;
+    }
+    public void setCommunityId(Long communityId) 
+    {
+        this.communityId = communityId;
+    }
+
+    public Long getCommunityId() 
+    {
+        return communityId;
+    }
+    public void setCommunityType(String communityType) 
+    {
+        this.communityType = communityType;
+    }
+
+    public String getCommunityType() 
+    {
+        return communityType;
+    }
+    public void setIsRoot(Integer isRoot) 
+    {
+        this.isRoot = isRoot;
+    }
+
+    public Integer getIsRoot() 
+    {
+        return isRoot;
+    }
+    public void setParentId(Long parentId) 
+    {
+        this.parentId = parentId;
+    }
+
+    public Long getParentId() 
+    {
+        return parentId;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setNickName(String nickName) 
+    {
+        this.nickName = nickName;
+    }
+
+    public String getNickName() 
+    {
+        return nickName;
+    }
+    public void setAvatar(String avatar) 
+    {
+        this.avatar = avatar;
+    }
+
+    public String getAvatar() 
+    {
+        return avatar;
+    }
+    public void setToUserId(Long toUserId) 
+    {
+        this.toUserId = toUserId;
+    }
+
+    public Long getToUserId() 
+    {
+        return toUserId;
+    }
+    public void setToNickName(String toNickName) 
+    {
+        this.toNickName = toNickName;
+    }
+
+    public String getToNickName() 
+    {
+        return toNickName;
+    }
+    public void setToAvatar(String toAvatar) 
+    {
+        this.toAvatar = toAvatar;
+    }
+
+    public String getToAvatar() 
+    {
+        return toAvatar;
+    }
+    public void setContentId(Long contentId) 
+    {
+        this.contentId = contentId;
+    }
+
+    public Long getContentId() 
+    {
+        return contentId;
+    }
+    public void setCommentContent(String commentContent) 
+    {
+        this.commentContent = commentContent;
+    }
+
+    public String getCommentContent() 
+    {
+        return commentContent;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("commentId", getCommentId())
+            .append("communityId", getCommunityId())
+            .append("communityType", getCommunityType())
+            .append("isRoot", getIsRoot())
+            .append("parentId", getParentId())
+            .append("userId", getUserId())
+            .append("nickName", getNickName())
+            .append("avatar", getAvatar())
+            .append("toUserId", getToUserId())
+            .append("toNickName", getToNickName())
+            .append("toAvatar", getToAvatar())
+            .append("contentId", getContentId())
+            .append("commentContent", getCommentContent())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 125 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentLikes.java

@@ -0,0 +1,125 @@
+package com.ruoyi.system.domain.communityNews;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 社区资讯点赞对象 comment_likes
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public class CommentLikes extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 点赞ID */
+    private Long likesId;
+
+    /** 点赞目标id */
+    @Excel(name = "点赞目标id")
+    private Long targetId;
+
+    /** 点赞目标类型(1:资讯 2:回复) */
+    @Excel(name = "点赞目标类型", readConverterExp = "1=:资讯,2=:回复")
+    private String targetType;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 用户昵称 */
+    @Excel(name = "用户昵称")
+    private String nickName;
+
+    /** 头像地址 */
+    @Excel(name = "头像地址")
+    private String avatar;
+
+    /** 逻辑删除(Y:已删除,N:未删除) */
+    private String delFlag;
+
+    public void setLikesId(Long likesId) 
+    {
+        this.likesId = likesId;
+    }
+
+    public Long getLikesId() 
+    {
+        return likesId;
+    }
+    public void setTargetId(Long targetId) 
+    {
+        this.targetId = targetId;
+    }
+
+    public Long getTargetId() 
+    {
+        return targetId;
+    }
+    public void setTargetType(String targetType) 
+    {
+        this.targetType = targetType;
+    }
+
+    public String getTargetType() 
+    {
+        return targetType;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setNickName(String nickName) 
+    {
+        this.nickName = nickName;
+    }
+
+    public String getNickName() 
+    {
+        return nickName;
+    }
+    public void setAvatar(String avatar) 
+    {
+        this.avatar = avatar;
+    }
+
+    public String getAvatar() 
+    {
+        return avatar;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("likesId", getLikesId())
+            .append("targetId", getTargetId())
+            .append("targetType", getTargetType())
+            .append("userId", getUserId())
+            .append("nickName", getNickName())
+            .append("avatar", getAvatar())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 125 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommentStars.java

@@ -0,0 +1,125 @@
+package com.ruoyi.system.domain.communityNews;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 社区资讯收藏对象 comment_stars
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public class CommentStars extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 社区资讯收藏ID */
+    private Long starsId;
+
+    /** 社区资讯ID */
+    @Excel(name = "社区资讯ID")
+    private Long communityId;
+
+    /** 社区资讯类型(1:公告 2:通知 3:资讯) */
+    @Excel(name = "社区资讯类型", readConverterExp = "1=:公告,2=:通知,3=:资讯")
+    private String communityType;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 用户昵称 */
+    @Excel(name = "用户昵称")
+    private String nickName;
+
+    /** 头像地址 */
+    @Excel(name = "头像地址")
+    private String avatar;
+
+    /** 逻辑删除(Y:已删除,N:未删除) */
+    private String delFlag;
+
+    public void setStarsId(Long starsId) 
+    {
+        this.starsId = starsId;
+    }
+
+    public Long getStarsId() 
+    {
+        return starsId;
+    }
+    public void setCommunityId(Long communityId) 
+    {
+        this.communityId = communityId;
+    }
+
+    public Long getCommunityId() 
+    {
+        return communityId;
+    }
+    public void setCommunityType(String communityType) 
+    {
+        this.communityType = communityType;
+    }
+
+    public String getCommunityType() 
+    {
+        return communityType;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setNickName(String nickName) 
+    {
+        this.nickName = nickName;
+    }
+
+    public String getNickName() 
+    {
+        return nickName;
+    }
+    public void setAvatar(String avatar) 
+    {
+        this.avatar = avatar;
+    }
+
+    public String getAvatar() 
+    {
+        return avatar;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("starsId", getStarsId())
+            .append("communityId", getCommunityId())
+            .append("communityType", getCommunityType())
+            .append("userId", getUserId())
+            .append("nickName", getNickName())
+            .append("avatar", getAvatar())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 85 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/CommunityNews.java

@@ -12,7 +12,7 @@ import java.util.Date;
  * 社区资讯对象 community_news
  * 
  * @author boman
- * @date 2025-02-14
+ * @date 2025-02-25
  */
 public class CommunityNews extends BaseEntity
 {
@@ -42,6 +42,18 @@ public class CommunityNews extends BaseEntity
     @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date publishTime;
 
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 员工管理id */
+    @Excel(name = "员工管理id")
+    private Long staffId;
+
+    /** 员工姓名 */
+    @Excel(name = "员工姓名")
+    private String staffName;
+
     /** 作者,记录资讯的发布者 */
     @Excel(name = "作者,记录资讯的发布者")
     private String author;
@@ -62,6 +74,18 @@ public class CommunityNews extends BaseEntity
     @Excel(name = "是否置顶:Y", readConverterExp = "置=顶")
     private String isTop;
 
+    /** 评论数量 */
+    @Excel(name = "评论数量")
+    private String userComment;
+
+    /** 点赞数量 */
+    @Excel(name = "点赞数量")
+    private String userLikes;
+
+    /** 收藏数量 */
+    @Excel(name = "收藏数量")
+    private String userStars;
+
     public void setCommunityId(Long communityId) 
     {
         this.communityId = communityId;
@@ -116,6 +140,33 @@ public class CommunityNews extends BaseEntity
     {
         return publishTime;
     }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setStaffId(Long staffId) 
+    {
+        this.staffId = staffId;
+    }
+
+    public Long getStaffId() 
+    {
+        return staffId;
+    }
+    public void setStaffName(String staffName) 
+    {
+        this.staffName = staffName;
+    }
+
+    public String getStaffName() 
+    {
+        return staffName;
+    }
     public void setAuthor(String author) 
     {
         this.author = author;
@@ -161,6 +212,33 @@ public class CommunityNews extends BaseEntity
     {
         return isTop;
     }
+    public void setUserComment(String userComment) 
+    {
+        this.userComment = userComment;
+    }
+
+    public String getUserComment() 
+    {
+        return userComment;
+    }
+    public void setUserLikes(String userLikes) 
+    {
+        this.userLikes = userLikes;
+    }
+
+    public String getUserLikes() 
+    {
+        return userLikes;
+    }
+    public void setUserStars(String userStars) 
+    {
+        this.userStars = userStars;
+    }
+
+    public String getUserStars() 
+    {
+        return userStars;
+    }
 
     @Override
     public String toString() {
@@ -171,11 +249,17 @@ public class CommunityNews extends BaseEntity
             .append("communityContent", getCommunityContent())
             .append("status", getStatus())
             .append("publishTime", getPublishTime())
+            .append("userId", getUserId())
+            .append("staffId", getStaffId())
+            .append("staffName", getStaffName())
             .append("author", getAuthor())
             .append("source", getSource())
             .append("coverImage", getCoverImage())
             .append("viewCount", getViewCount())
             .append("isTop", getIsTop())
+            .append("userComment", getUserComment())
+            .append("userLikes", getUserLikes())
+            .append("userStars", getUserStars())
             .append("createBy", getCreateBy())
             .append("createTime", getCreateTime())
             .append("updateBy", getUpdateBy())

+ 136 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/CommentChildrenVo.java

@@ -0,0 +1,136 @@
+package com.ruoyi.system.domain.communityNews.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 评论前端所需要格式主体的子集,子集里面是回复的人和被回复的人
+ * @Author: tjf
+ * @Date: 2025/2/25 15:55
+ * @Describe:
+ */
+public class CommentChildrenVo implements Serializable {
+    /**
+     * [
+     *         {
+     *           id: 1,
+     *           commentUser: {
+     *             id: 1,
+     *             nickName: "花非花",
+     *             avatar:
+     *               "http://qzapp.qlogo.cn/qzapp/101483738/6637A2B6611592A44A7699D14E13F7F7/50",
+     *           },
+     *           content:
+     *             "<a style='text-decoration:none;color: #409eff ' href='https://blog.csdn.net/qq_40942490?spm=1000.2115.3001.5113'>我的CSDN博客地址</a>[害羞][害羞][害羞]<br/>",
+     *           createDate: "2019-9-23 17:36:02",
+     *           childrenList: [
+     *             {
+     *               id: 2,
+     *               commentUser: {
+     *                 id: 2,
+     *                 nickName: "坏菠萝",
+     *                 avatar: "",
+     *               },
+     *               targetUser: {
+     *                 id: 1,
+     *                 nickName: "花非花",
+     *                 avatar:
+     *                   "http://qzapp.qlogo.cn/qzapp/101483738/6637A2B6611592A44A7699D14E13F7F7/50",
+     *               },
+     *               content: "真的就很棒!很Nice![爱你]",
+     *               createDate: "2019-9-23 17:45:26",
+     *             },
+     *           ],
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 回复的人
+     */
+    private CommentUserVo commentUserVo;
+
+
+    /**
+     * 被回复的人
+     */
+    private TargetUserVo targetUserVo;
+
+    /**
+     * 内容
+     */
+    private String content;
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 点赞数量
+     */
+    private Integer likeCount;
+    /**
+     * 当前人员是否点赞
+     */
+    private String isLike;
+
+    public Integer getLikeCount() {
+        return likeCount;
+    }
+
+    public void setLikeCount(Integer likeCount) {
+        this.likeCount = likeCount;
+    }
+
+    public String getIsLike() {
+        return isLike;
+    }
+
+    public void setIsLike(String isLike) {
+        this.isLike = isLike;
+    }
+
+    public CommentUserVo getCommentUserVo() {
+        return commentUserVo;
+    }
+
+    public void setCommentUserVo(CommentUserVo commentUserVo) {
+        this.commentUserVo = commentUserVo;
+    }
+
+    public TargetUserVo getTargetUserVo() {
+        return targetUserVo;
+    }
+
+    public void setTargetUserVo(TargetUserVo targetUserVo) {
+        this.targetUserVo = targetUserVo;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @Override
+    public String toString() {
+        return "CommentChildrenVo{" +
+                "commentUserVo=" + commentUserVo +
+                ", targetUserVo=" + targetUserVo +
+                ", content='" + content + '\'' +
+                ", createTime=" + createTime +
+                ", likeCount=" + likeCount +
+                ", isLike='" + isLike + '\'' +
+                '}';
+    }
+}

+ 147 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/CommentIndexVo.java

@@ -0,0 +1,147 @@
+package com.ruoyi.system.domain.communityNews.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 评论前端所需要格式主体
+ * @Author: tjf
+ * @Date: 2025/2/25 15:49
+ * @Describe:
+ */
+public class CommentIndexVo implements Serializable {
+    /**
+     * [
+     *         {
+     *           id: 1,
+     *           commentUser: {
+     *             id: 1,
+     *             nickName: "花非花",
+     *             avatar:
+     *               "http://qzapp.qlogo.cn/qzapp/101483738/6637A2B6611592A44A7699D14E13F7F7/50",
+     *           },
+     *           content:
+     *             "<a style='text-decoration:none;color: #409eff ' href='https://blog.csdn.net/qq_40942490?spm=1000.2115.3001.5113'>我的CSDN博客地址</a>[害羞][害羞][害羞]<br/>",
+     *           createDate: "2019-9-23 17:36:02",
+     *           childrenList: [
+     *             {
+     *               id: 2,
+     *               commentUser: {
+     *                 id: 2,
+     *                 nickName: "坏菠萝",
+     *                 avatar: "",
+     *               },
+     *               targetUser: {
+     *                 id: 1,
+     *                 nickName: "花非花",
+     *                 avatar:
+     *                   "http://qzapp.qlogo.cn/qzapp/101483738/6637A2B6611592A44A7699D14E13F7F7/50",
+     *               },
+     *               content: "真的就很棒!很Nice![爱你]",
+     *               createDate: "2019-9-23 17:45:26",
+     *             },
+     *           ],
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 评论主体id
+     */
+    private Long id;
+    /**
+     * 回复的人
+     */
+    private CommentUserVo commentUserVo;
+    /**
+     * 内容
+     */
+    private String content;
+    /**
+     * 点赞数量
+     */
+    private Integer likeCount;
+    /**
+     * 当前人员是否点赞
+     */
+    private String isLike;
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 评论子集
+     */
+    private List<CommentChildrenVo> childrenList;
+
+    public Integer getLikeCount() {
+        return likeCount;
+    }
+
+    public void setLikeCount(Integer likeCount) {
+        this.likeCount = likeCount;
+    }
+
+    public String getIsLike() {
+        return isLike;
+    }
+
+    public void setIsLike(String isLike) {
+        this.isLike = isLike;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public CommentUserVo getCommentUserVo() {
+        return commentUserVo;
+    }
+
+    public void setCommentUserVo(CommentUserVo commentUserVo) {
+        this.commentUserVo = commentUserVo;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public List<CommentChildrenVo> getChildrenList() {
+        return childrenList;
+    }
+
+    public void setChildrenList(List<CommentChildrenVo> childrenList) {
+        this.childrenList = childrenList;
+    }
+
+    @Override
+    public String toString() {
+        return "CommentIndexVo{" +
+                "id=" + id +
+                ", commentUserVo=" + commentUserVo +
+                ", content='" + content + '\'' +
+                ", likeCount=" + likeCount +
+                ", isLike='" + isLike + '\'' +
+                ", createTime=" + createTime +
+                ", childrenList=" + childrenList +
+                '}';
+    }
+}

+ 76 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/CommentUserVo.java

@@ -0,0 +1,76 @@
+package com.ruoyi.system.domain.communityNews.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 评论前端所需要格式回复的人
+ * @Author: tjf
+ * @Date: 2025/2/25 15:56
+ * @Describe:
+ */
+public class CommentUserVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 人员的userID
+     */
+    private Long id;
+    /**
+     * 人员名称
+     */
+    private String nickName;
+    /**
+     * 头像
+     */
+    private String avatar;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    @Override
+    public String toString() {
+        return "CommentUserVo{" +
+                "id=" + id +
+                ", nickName='" + nickName + '\'' +
+                ", avatar='" + avatar + '\'' +
+                ", createTime=" + createTime +
+                '}';
+    }
+}

+ 74 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/communityNews/vo/TargetUserVo.java

@@ -0,0 +1,74 @@
+package com.ruoyi.system.domain.communityNews.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 评论前端所需要格式被回复的人
+ * @Author: tjf
+ * @Date: 2025/2/25 15:54
+ * @Describe:
+ */
+public class TargetUserVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 人员的userID
+     */
+    private Long id;
+    /**
+     * 人员名称
+     */
+    private String nickName;
+    /**
+     * 头像
+     */
+    private String avatar;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    @Override
+    public String toString() {
+        return "CommentUserVo{" +
+                "id=" + id +
+                ", nickName='" + nickName + '\'' +
+                ", avatar='" + avatar + '\'' +
+                ", createTime=" + createTime +
+                '}';
+    }
+}

+ 77 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentContentMapper.java

@@ -0,0 +1,77 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.communityNews.CommentContent;
+
+import java.util.List;
+
+
+/**
+ * 社区资讯评论内容Mapper接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface CommentContentMapper 
+{
+    /**
+     * 查询社区资讯评论内容
+     * 
+     * @param contentId 社区资讯评论内容主键
+     * @return 社区资讯评论内容
+     */
+    public CommentContent selectCommentContentByContentId(Long contentId);
+
+    /**
+     * 查询社区资讯评论内容列表
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 社区资讯评论内容集合
+     */
+    public List<CommentContent> selectCommentContentList(CommentContent commentContent);
+
+    /**
+     * 新增社区资讯评论内容
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 结果
+     */
+    public int insertCommentContent(CommentContent commentContent);
+
+    /**
+     * 修改社区资讯评论内容
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 结果
+     */
+    public int updateCommentContent(CommentContent commentContent);
+
+    /**
+     * 删除社区资讯评论内容
+     * 
+     * @param contentId 社区资讯评论内容主键
+     * @return 结果
+     */
+    public int deleteCommentContentByContentId(Long contentId);
+
+    /**
+     * 批量删除社区资讯评论内容
+     * 
+     * @param contentIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCommentContentByContentIds(Long[] contentIds);
+
+    /**
+     * 更新社区资讯评论内容表
+     * @param contentId 内容主键
+     * @return
+     */
+    public int updateCommentContentByContentId(Long contentId);
+
+    /**
+     * 更新社区资讯评论内容表
+     * @param commentId 评论id
+     * @return
+     */
+    public int updateCommentContentByCommentId(Long commentId);
+}

+ 73 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentIndexMapper.java

@@ -0,0 +1,73 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.communityNews.CommentIndex;
+import com.ruoyi.system.domain.communityNews.vo.CommentIndexVo;
+
+import java.util.List;
+
+
+/**
+ * 社区资讯评论Mapper接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface CommentIndexMapper 
+{
+    /**
+     * 查询社区资讯评论
+     * 
+     * @param commentId 社区资讯评论主键
+     * @return 社区资讯评论
+     */
+    public CommentIndex selectCommentIndexByCommentId(Long commentId);
+
+    /**
+     * 查询社区资讯评论列表
+     * 
+     * @param commentIndex 社区资讯评论
+     * @return 社区资讯评论集合
+     */
+    public List<CommentIndex> selectCommentIndexList(CommentIndex commentIndex);
+
+    /**
+     * 查询所有评论组装成前端所需要的数据结构
+     * @param commentIndex
+     * @return
+     */
+    public List<CommentIndexVo> getAllComment(CommentIndex commentIndex);
+
+    /**
+     * 新增社区资讯评论
+     * 
+     * @param commentIndex 社区资讯评论
+     * @return 结果
+     */
+    public int insertCommentIndex(CommentIndex commentIndex);
+
+    /**
+     * 修改社区资讯评论
+     * 
+     * @param commentIndex 社区资讯评论
+     * @return 结果
+     */
+    public int updateCommentIndex(CommentIndex commentIndex);
+
+    /**
+     * 删除社区资讯评论
+     * 
+     * @param commentId 社区资讯评论主键
+     * @return 结果
+     */
+    public int deleteCommentIndexByCommentId(Long commentId);
+    public int updateCommentIndexByCommentId(Long commentId);
+    public int updateCommentIndexByParentId(Long commentId);
+
+    /**
+     * 批量删除社区资讯评论
+     * 
+     * @param commentIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCommentIndexByCommentIds(Long[] commentIds);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentLikesMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.communityNews.CommentLikes;
+
+import java.util.List;
+
+
+/**
+ * 社区资讯点赞Mapper接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface CommentLikesMapper 
+{
+    /**
+     * 查询社区资讯点赞
+     * 
+     * @param likesId 社区资讯点赞主键
+     * @return 社区资讯点赞
+     */
+    public CommentLikes selectCommentLikesByLikesId(Long likesId);
+
+    /**
+     * 查询社区资讯点赞列表
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 社区资讯点赞集合
+     */
+    public List<CommentLikes> selectCommentLikesList(CommentLikes commentLikes);
+
+    /**
+     * 新增社区资讯点赞
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 结果
+     */
+    public int insertCommentLikes(CommentLikes commentLikes);
+
+    /**
+     * 修改社区资讯点赞
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 结果
+     */
+    public int updateCommentLikes(CommentLikes commentLikes);
+
+    /**
+     * 删除社区资讯点赞
+     * 
+     * @param likesId 社区资讯点赞主键
+     * @return 结果
+     */
+    public int deleteCommentLikesByLikesId(Long likesId);
+
+    /**
+     * 批量删除社区资讯点赞
+     * 
+     * @param likesIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCommentLikesByLikesIds(Long[] likesIds);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentStarsMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.communityNews.CommentStars;
+
+import java.util.List;
+
+/**
+ * 社区资讯收藏Mapper接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface CommentStarsMapper 
+{
+    /**
+     * 查询社区资讯收藏
+     * 
+     * @param starsId 社区资讯收藏主键
+     * @return 社区资讯收藏
+     */
+    public CommentStars selectCommentStarsByStarsId(Long starsId);
+
+    /**
+     * 查询社区资讯收藏列表
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 社区资讯收藏集合
+     */
+    public List<CommentStars> selectCommentStarsList(CommentStars commentStars);
+
+    /**
+     * 新增社区资讯收藏
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 结果
+     */
+    public int insertCommentStars(CommentStars commentStars);
+
+    /**
+     * 修改社区资讯收藏
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 结果
+     */
+    public int updateCommentStars(CommentStars commentStars);
+
+    /**
+     * 删除社区资讯收藏
+     * 
+     * @param starsId 社区资讯收藏主键
+     * @return 结果
+     */
+    public int deleteCommentStarsByStarsId(Long starsId);
+
+    /**
+     * 批量删除社区资讯收藏
+     * 
+     * @param starsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCommentStarsByStarsIds(Long[] starsIds);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentContentService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.communityNews.CommentContent;
+
+import java.util.List;
+
+
+/**
+ * 社区资讯评论内容Service接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface ICommentContentService 
+{
+    /**
+     * 查询社区资讯评论内容
+     * 
+     * @param contentId 社区资讯评论内容主键
+     * @return 社区资讯评论内容
+     */
+    public CommentContent selectCommentContentByContentId(Long contentId);
+
+    /**
+     * 查询社区资讯评论内容列表
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 社区资讯评论内容集合
+     */
+    public List<CommentContent> selectCommentContentList(CommentContent commentContent);
+
+    /**
+     * 新增社区资讯评论内容
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 结果
+     */
+    public int insertCommentContent(CommentContent commentContent);
+
+    /**
+     * 修改社区资讯评论内容
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 结果
+     */
+    public int updateCommentContent(CommentContent commentContent);
+
+    /**
+     * 批量删除社区资讯评论内容
+     * 
+     * @param contentIds 需要删除的社区资讯评论内容主键集合
+     * @return 结果
+     */
+    public int deleteCommentContentByContentIds(Long[] contentIds);
+
+    /**
+     * 删除社区资讯评论内容信息
+     * 
+     * @param contentId 社区资讯评论内容主键
+     * @return 结果
+     */
+    public int deleteCommentContentByContentId(Long contentId);
+}

+ 71 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentIndexService.java

@@ -0,0 +1,71 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.communityNews.CommentIndex;
+
+import java.util.List;
+
+
+/**
+ * 社区资讯评论Service接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface ICommentIndexService 
+{
+    /**
+     * 查询社区资讯评论
+     * 
+     * @param commentId 社区资讯评论主键
+     * @return 社区资讯评论
+     */
+    public CommentIndex selectCommentIndexByCommentId(Long commentId);
+
+    /**
+     * 查询社区资讯评论列表
+     * 
+     * @param commentIndex 社区资讯评论
+     * @return 社区资讯评论集合
+     */
+    public List<CommentIndex> selectCommentIndexList(CommentIndex commentIndex);
+
+    /**
+     * 新增社区资讯评论
+     * 
+     * @param commentIndex 社区资讯评论
+     * @return 结果
+     */
+    public int insertCommentIndex(CommentIndex commentIndex);
+
+    /**
+     * 修改社区资讯评论
+     * 
+     * @param commentIndex 社区资讯评论
+     * @return 结果
+     */
+    public int updateCommentIndex(CommentIndex commentIndex);
+
+    /**
+     * 批量删除社区资讯评论
+     * 
+     * @param commentIds 需要删除的社区资讯评论主键集合
+     * @return 结果
+     */
+    public int deleteCommentIndexByCommentIds(Long[] commentIds);
+
+    /**
+     * 删除社区资讯评论信息
+     * 
+     * @param commentId 社区资讯评论主键
+     * @return 结果
+     */
+    public int deleteCommentIndexByCommentId(Long commentId);
+
+    /**
+     * 查询所有评论组装成前端所需要的数据结构
+     * @param commentIndex
+     * @return
+     */
+    public AjaxResult getAllComment(CommentIndex commentIndex);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentLikesService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.communityNews.CommentLikes;
+
+import java.util.List;
+
+/**
+ * 社区资讯点赞Service接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface ICommentLikesService 
+{
+    /**
+     * 查询社区资讯点赞
+     * 
+     * @param likesId 社区资讯点赞主键
+     * @return 社区资讯点赞
+     */
+    public CommentLikes selectCommentLikesByLikesId(Long likesId);
+
+    /**
+     * 查询社区资讯点赞列表
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 社区资讯点赞集合
+     */
+    public List<CommentLikes> selectCommentLikesList(CommentLikes commentLikes);
+
+    /**
+     * 新增社区资讯点赞
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 结果
+     */
+    public int insertCommentLikes(CommentLikes commentLikes);
+
+    /**
+     * 修改社区资讯点赞
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 结果
+     */
+    public int updateCommentLikes(CommentLikes commentLikes);
+
+    /**
+     * 批量删除社区资讯点赞
+     * 
+     * @param likesIds 需要删除的社区资讯点赞主键集合
+     * @return 结果
+     */
+    public int deleteCommentLikesByLikesIds(Long[] likesIds);
+
+    /**
+     * 删除社区资讯点赞信息
+     * 
+     * @param likesId 社区资讯点赞主键
+     * @return 结果
+     */
+    public int deleteCommentLikesByLikesId(Long likesId);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentStarsService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.communityNews.CommentStars;
+
+import java.util.List;
+
+
+/**
+ * 社区资讯收藏Service接口
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+public interface ICommentStarsService 
+{
+    /**
+     * 查询社区资讯收藏
+     * 
+     * @param starsId 社区资讯收藏主键
+     * @return 社区资讯收藏
+     */
+    public CommentStars selectCommentStarsByStarsId(Long starsId);
+
+    /**
+     * 查询社区资讯收藏列表
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 社区资讯收藏集合
+     */
+    public List<CommentStars> selectCommentStarsList(CommentStars commentStars);
+
+    /**
+     * 新增社区资讯收藏
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 结果
+     */
+    public int insertCommentStars(CommentStars commentStars);
+
+    /**
+     * 修改社区资讯收藏
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 结果
+     */
+    public int updateCommentStars(CommentStars commentStars);
+
+    /**
+     * 批量删除社区资讯收藏
+     * 
+     * @param starsIds 需要删除的社区资讯收藏主键集合
+     * @return 结果
+     */
+    public int deleteCommentStarsByStarsIds(Long[] starsIds);
+
+    /**
+     * 删除社区资讯收藏信息
+     * 
+     * @param starsId 社区资讯收藏主键
+     * @return 结果
+     */
+    public int deleteCommentStarsByStarsId(Long starsId);
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentContentServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.communityNews.CommentContent;
+import com.ruoyi.system.mapper.CommentContentMapper;
+import com.ruoyi.system.service.ICommentContentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 社区资讯评论内容Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+@Service
+public class CommentContentServiceImpl implements ICommentContentService 
+{
+    @Autowired
+    private CommentContentMapper commentContentMapper;
+
+    /**
+     * 查询社区资讯评论内容
+     * 
+     * @param contentId 社区资讯评论内容主键
+     * @return 社区资讯评论内容
+     */
+    @Override
+    public CommentContent selectCommentContentByContentId(Long contentId)
+    {
+        return commentContentMapper.selectCommentContentByContentId(contentId);
+    }
+
+    /**
+     * 查询社区资讯评论内容列表
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 社区资讯评论内容
+     */
+    @Override
+    public List<CommentContent> selectCommentContentList(CommentContent commentContent)
+    {
+        return commentContentMapper.selectCommentContentList(commentContent);
+    }
+
+    /**
+     * 新增社区资讯评论内容
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 结果
+     */
+    @Override
+    public int insertCommentContent(CommentContent commentContent)
+    {
+        commentContent.setCreateTime(DateUtils.getNowDate());
+        return commentContentMapper.insertCommentContent(commentContent);
+    }
+
+    /**
+     * 修改社区资讯评论内容
+     * 
+     * @param commentContent 社区资讯评论内容
+     * @return 结果
+     */
+    @Override
+    public int updateCommentContent(CommentContent commentContent)
+    {
+        commentContent.setUpdateTime(DateUtils.getNowDate());
+        return commentContentMapper.updateCommentContent(commentContent);
+    }
+
+    /**
+     * 批量删除社区资讯评论内容
+     * 
+     * @param contentIds 需要删除的社区资讯评论内容主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCommentContentByContentIds(Long[] contentIds)
+    {
+        return commentContentMapper.deleteCommentContentByContentIds(contentIds);
+    }
+
+    /**
+     * 删除社区资讯评论内容信息
+     * 
+     * @param contentId 社区资讯评论内容主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCommentContentByContentId(Long contentId)
+    {
+        return commentContentMapper.deleteCommentContentByContentId(contentId);
+    }
+}

+ 146 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentIndexServiceImpl.java

@@ -0,0 +1,146 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.communityNews.CommentContent;
+import com.ruoyi.system.domain.communityNews.CommentIndex;
+import com.ruoyi.system.domain.communityNews.vo.CommentIndexVo;
+import com.ruoyi.system.mapper.CommentContentMapper;
+import com.ruoyi.system.mapper.CommentIndexMapper;
+import com.ruoyi.system.service.ICommentIndexService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 社区资讯评论Service业务层处理
+ *
+ * @author boman
+ * @date 2025-02-25
+ */
+@Service
+public class CommentIndexServiceImpl implements ICommentIndexService {
+    @Autowired
+    private CommentIndexMapper commentIndexMapper;
+    @Autowired
+    private CommentContentMapper commentContentMapper;
+
+    /**
+     * 查询社区资讯评论
+     *
+     * @param commentId 社区资讯评论主键
+     * @return 社区资讯评论
+     */
+    @Override
+    public CommentIndex selectCommentIndexByCommentId(Long commentId) {
+        return commentIndexMapper.selectCommentIndexByCommentId(commentId);
+    }
+
+    /**
+     * 查询社区资讯评论列表
+     *
+     * @param commentIndex 社区资讯评论
+     * @return 社区资讯评论
+     */
+    @Override
+    public List<CommentIndex> selectCommentIndexList(CommentIndex commentIndex) {
+        return commentIndexMapper.selectCommentIndexList(commentIndex);
+    }
+
+    /**
+     * 新增社区资讯评论
+     *
+     * @param commentIndex 社区资讯评论
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int insertCommentIndex(CommentIndex commentIndex) {
+        Long userId = SecurityUtils.getUserId();
+        String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
+        String avatar = SecurityUtils.getLoginUser().getUser().getAvatar();
+        commentIndex.setUserId(userId);
+        commentIndex.setNickName(nickName);
+        commentIndex.setAvatar(avatar);
+        //需要插入评论内容表
+        CommentContent commentContent = new CommentContent();
+        commentContent.setUserId(userId);
+        commentContent.setCommentContent(commentIndex.getCommentContent());
+        commentContentMapper.insertCommentContent(commentContent);
+        int result = 1;
+        //有社区资讯ID才能新增评论
+        if (commentIndex.getCommunityId() != null) {
+            //说明是根评论
+            commentIndex.setCreateTime(DateUtils.getNowDate());
+            commentIndex.setContentId(commentContent.getContentId());
+            result = commentIndexMapper.insertCommentIndex(commentIndex);
+            //再把评论内容表更新上资讯评论表id
+            commentContent.setCommentId(commentIndex.getCommentId());
+            commentContentMapper.updateCommentContent(commentContent);
+        }
+        return result;
+    }
+
+    /**
+     * 修改社区资讯评论
+     *
+     * @param commentIndex 社区资讯评论
+     * @return 结果
+     */
+    @Override
+    public int updateCommentIndex(CommentIndex commentIndex) {
+        commentIndex.setUpdateTime(DateUtils.getNowDate());
+        return commentIndexMapper.updateCommentIndex(commentIndex);
+    }
+
+    /**
+     * 批量删除社区资讯评论
+     *
+     * @param commentIds 需要删除的社区资讯评论主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCommentIndexByCommentIds(Long[] commentIds) {
+        return commentIndexMapper.deleteCommentIndexByCommentIds(commentIds);
+    }
+
+    /**
+     * 删除社区资讯评论信息
+     *
+     * @param commentId 社区资讯评论主键
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int deleteCommentIndexByCommentId(Long commentId) {
+        //只能删除自己的评论
+        CommentIndex commentIndex = commentIndexMapper.selectCommentIndexByCommentId(commentId);
+        int result = 0;
+        if (commentIndex != null && commentIndex.getUserId().equals(SecurityUtils.getUserId())) {
+            result = commentIndexMapper.updateCommentIndexByCommentId(commentId);
+            //删除评论内容表数据
+            commentContentMapper.updateCommentContentByContentId(commentIndex.getCommentId());
+            //如果是根评论删除,删除所有子评论
+           if (1 == commentIndex.getIsRoot()){
+               commentIndexMapper.updateCommentIndexByParentId(commentId);
+               //删除评论内容表数据
+               commentContentMapper.updateCommentContentByCommentId(commentIndex.getCommentId());
+           }
+        }
+        return result;
+    }
+
+    /**
+     * 查询所有评论组装成前端所需要的数据结构
+     * @param commentIndex
+     * @return
+     */
+    @Override
+    public AjaxResult getAllComment(CommentIndex commentIndex) {
+        List<CommentIndexVo> allComment = commentIndexMapper.getAllComment(commentIndex);
+        return AjaxResult.success(allComment);
+    }
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentLikesServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.communityNews.CommentLikes;
+import com.ruoyi.system.mapper.CommentLikesMapper;
+import com.ruoyi.system.service.ICommentLikesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 社区资讯点赞Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+@Service
+public class CommentLikesServiceImpl implements ICommentLikesService 
+{
+    @Autowired
+    private CommentLikesMapper commentLikesMapper;
+
+    /**
+     * 查询社区资讯点赞
+     * 
+     * @param likesId 社区资讯点赞主键
+     * @return 社区资讯点赞
+     */
+    @Override
+    public CommentLikes selectCommentLikesByLikesId(Long likesId)
+    {
+        return commentLikesMapper.selectCommentLikesByLikesId(likesId);
+    }
+
+    /**
+     * 查询社区资讯点赞列表
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 社区资讯点赞
+     */
+    @Override
+    public List<CommentLikes> selectCommentLikesList(CommentLikes commentLikes)
+    {
+        return commentLikesMapper.selectCommentLikesList(commentLikes);
+    }
+
+    /**
+     * 新增社区资讯点赞
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 结果
+     */
+    @Override
+    public int insertCommentLikes(CommentLikes commentLikes)
+    {
+        commentLikes.setCreateTime(DateUtils.getNowDate());
+        return commentLikesMapper.insertCommentLikes(commentLikes);
+    }
+
+    /**
+     * 修改社区资讯点赞
+     * 
+     * @param commentLikes 社区资讯点赞
+     * @return 结果
+     */
+    @Override
+    public int updateCommentLikes(CommentLikes commentLikes)
+    {
+        commentLikes.setUpdateTime(DateUtils.getNowDate());
+        return commentLikesMapper.updateCommentLikes(commentLikes);
+    }
+
+    /**
+     * 批量删除社区资讯点赞
+     * 
+     * @param likesIds 需要删除的社区资讯点赞主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCommentLikesByLikesIds(Long[] likesIds)
+    {
+        return commentLikesMapper.deleteCommentLikesByLikesIds(likesIds);
+    }
+
+    /**
+     * 删除社区资讯点赞信息
+     * 
+     * @param likesId 社区资讯点赞主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCommentLikesByLikesId(Long likesId)
+    {
+        return commentLikesMapper.deleteCommentLikesByLikesId(likesId);
+    }
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentStarsServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.communityNews.CommentStars;
+import com.ruoyi.system.mapper.CommentStarsMapper;
+import com.ruoyi.system.service.ICommentStarsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 社区资讯收藏Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-02-25
+ */
+@Service
+public class CommentStarsServiceImpl implements ICommentStarsService 
+{
+    @Autowired
+    private CommentStarsMapper commentStarsMapper;
+
+    /**
+     * 查询社区资讯收藏
+     * 
+     * @param starsId 社区资讯收藏主键
+     * @return 社区资讯收藏
+     */
+    @Override
+    public CommentStars selectCommentStarsByStarsId(Long starsId)
+    {
+        return commentStarsMapper.selectCommentStarsByStarsId(starsId);
+    }
+
+    /**
+     * 查询社区资讯收藏列表
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 社区资讯收藏
+     */
+    @Override
+    public List<CommentStars> selectCommentStarsList(CommentStars commentStars)
+    {
+        return commentStarsMapper.selectCommentStarsList(commentStars);
+    }
+
+    /**
+     * 新增社区资讯收藏
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 结果
+     */
+    @Override
+    public int insertCommentStars(CommentStars commentStars)
+    {
+        commentStars.setCreateTime(DateUtils.getNowDate());
+        return commentStarsMapper.insertCommentStars(commentStars);
+    }
+
+    /**
+     * 修改社区资讯收藏
+     * 
+     * @param commentStars 社区资讯收藏
+     * @return 结果
+     */
+    @Override
+    public int updateCommentStars(CommentStars commentStars)
+    {
+        commentStars.setUpdateTime(DateUtils.getNowDate());
+        return commentStarsMapper.updateCommentStars(commentStars);
+    }
+
+    /**
+     * 批量删除社区资讯收藏
+     * 
+     * @param starsIds 需要删除的社区资讯收藏主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCommentStarsByStarsIds(Long[] starsIds)
+    {
+        return commentStarsMapper.deleteCommentStarsByStarsIds(starsIds);
+    }
+
+    /**
+     * 删除社区资讯收藏信息
+     * 
+     * @param starsId 社区资讯收藏主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCommentStarsByStarsId(Long starsId)
+    {
+        return commentStarsMapper.deleteCommentStarsByStarsId(starsId);
+    }
+}

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommunityAssetsServiceImpl.java

@@ -105,7 +105,7 @@ public class CommunityAssetsServiceImpl implements ICommunityAssetsService
     @Override
     public boolean checkEquipmentNumberUnique(CommunityAssets communityAssets) {
         Long communityAssetId = StringUtils.isNull(communityAssets.getCommunityAssetId()) ? -1L : communityAssets.getCommunityAssetId();
-        CommunityAssets info = communityAssetsMapper.checkEquipmentNumberUnique(communityAssets.getAssetName());
+        CommunityAssets info = communityAssetsMapper.checkEquipmentNumberUnique(communityAssets.getEquipmentNumber());
         if (StringUtils.isNotNull(info) && info.getCommunityAssetId().longValue() != communityAssetId.longValue())
         {
             return UserConstants.NOT_UNIQUE;

+ 113 - 0
ruoyi-system/src/main/resources/mapper/system/CommentContentMapper.xml

@@ -0,0 +1,113 @@
+<?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.ruoyi.system.mapper.CommentContentMapper">
+    
+    <resultMap type="CommentContent" id="CommentContentResult">
+        <result property="contentId"    column="content_id"    />
+        <result property="commentId"    column="comment_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="commentContent"    column="comment_content"    />
+        <result property="status"    column="status"    />
+        <result property="type"    column="type"    />
+        <result property="likeCount"    column="like_count"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectCommentContentVo">
+        select content_id, comment_id, user_id, comment_content, status, type, like_count, del_flag, create_by, create_time, update_by, update_time, remark from comment_content
+    </sql>
+
+    <select id="selectCommentContentList" parameterType="CommentContent" resultMap="CommentContentResult">
+        <include refid="selectCommentContentVo"/>
+        <where>  
+            <if test="commentId != null "> and comment_id = #{commentId}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="commentContent != null  and commentContent != ''"> and comment_content = #{commentContent}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="likeCount != null "> and like_count = #{likeCount}</if>
+        </where>
+    </select>
+    
+    <select id="selectCommentContentByContentId" parameterType="Long" resultMap="CommentContentResult">
+        <include refid="selectCommentContentVo"/>
+        where content_id = #{contentId}
+    </select>
+
+    <insert id="insertCommentContent" parameterType="CommentContent">
+        insert into comment_content
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="contentId != null">content_id,</if>
+            <if test="commentId != null">comment_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="commentContent != null">comment_content,</if>
+            <if test="status != null">status,</if>
+            <if test="type != null">type,</if>
+            <if test="likeCount != null">like_count,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="contentId != null">#{contentId},</if>
+            <if test="commentId != null">#{commentId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="commentContent != null">#{commentContent},</if>
+            <if test="status != null">#{status},</if>
+            <if test="type != null">#{type},</if>
+            <if test="likeCount != null">#{likeCount},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCommentContent" parameterType="CommentContent">
+        update comment_content
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="commentId != null">comment_id = #{commentId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="commentContent != null">comment_content = #{commentContent},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="likeCount != null">like_count = #{likeCount},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where content_id = #{contentId}
+    </update>
+    <update id="updateCommentContentByContentId" parameterType="CommentContent">
+        update comment_content set del_flag = 'Y' where content_id = #{contentId}
+    </update>
+    <update id="updateCommentContentByCommentId" parameterType="CommentContent">
+        update comment_content set del_flag = 'Y' where comment_id = #{commentId}
+    </update>
+
+    <delete id="deleteCommentContentByContentId" parameterType="Long">
+        delete from comment_content where content_id = #{contentId}
+    </delete>
+
+    <delete id="deleteCommentContentByContentIds" parameterType="String">
+        delete from comment_content where content_id in 
+        <foreach item="contentId" collection="array" open="(" separator="," close=")">
+            #{contentId}
+        </foreach>
+    </delete>
+</mapper>

+ 247 - 0
ruoyi-system/src/main/resources/mapper/system/CommentIndexMapper.xml

@@ -0,0 +1,247 @@
+<?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.ruoyi.system.mapper.CommentIndexMapper">
+
+    <resultMap type="CommentIndex" id="CommentIndexResult">
+        <result property="commentId" column="comment_id"/>
+        <result property="communityId" column="community_id"/>
+        <result property="communityType" column="community_type"/>
+        <result property="isRoot" column="is_root"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="userId" column="user_id"/>
+        <result property="nickName" column="nick_name"/>
+        <result property="avatar" column="avatar"/>
+        <result property="toUserId" column="to_user_id"/>
+        <result property="toNickName" column="to_nick_name"/>
+        <result property="toAvatar" column="to_avatar"/>
+        <result property="contentId" column="content_id"/>
+        <result property="commentContent" column="comment_content"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+    <!--回复列表返回给前端的格式-->
+    <resultMap type="com.ruoyi.system.domain.communityNews.vo.CommentIndexVo" id="CommentIndexVoResult">
+        <id property="id" column="ci_id"/>
+        <result property="content" column="ci_content"/>
+        <result property="likeCount" column="ci_likeCount"/>
+        <result property="isLike" column="ci_isLike"/>
+        <result property="createTime" column="ci_create_time"/>
+        <association property="commentUserVo" javaType="com.ruoyi.system.domain.communityNews.vo.CommentUserVo"
+                     resultMap="CommentUserVoResult"/>
+        <collection property="childrenList" javaType="java.util.List" resultMap="ChildrenListResult"/>
+    </resultMap>
+    <resultMap id="ChildrenListResult" type="com.ruoyi.system.domain.communityNews.vo.CommentChildrenVo">
+        <result property="content" column="cl_content"/>
+        <result property="likeCount" column="cl_likeCount"/>
+        <result property="isLike" column="cl_isLike"/>
+        <result property="createTime" column="cl_create_time"/>
+        <association property="commentUserVo" javaType="com.ruoyi.system.domain.communityNews.vo.CommentUserVo"
+                     resultMap="CommentUserVoResult"/>
+        <association property="targetUserVo" javaType="com.ruoyi.system.domain.communityNews.vo.TargetUserVo"
+                     resultMap="TargetUserVoResult"/>
+    </resultMap>
+    <resultMap id="CommentUserVoResult" type="com.ruoyi.system.domain.communityNews.vo.CommentUserVo">
+        <id property="id" column="cu_id"/>
+        <result property="nickName" column="cu_nickName"/>
+        <result property="avatar" column="cu_avatar"/>
+        <result property="createTime" column="cl_create_time"/>
+    </resultMap>
+    <resultMap id="TargetUserVoResult" type="com.ruoyi.system.domain.communityNews.vo.TargetUserVo">
+        <id property="id" column="tu_id"/>
+        <result property="nickName" column="tu_nickName"/>
+        <result property="avatar" column="tu_avatar"/>
+        <result property="createTime" column="tu_create_time"/>
+    </resultMap>
+
+
+    <sql id="selectCommentIndexVo">
+        select comment_id,
+               community_id,
+               community_type,
+               is_root,
+               parent_id,
+               user_id,
+               nick_name,
+               avatar,
+               to_user_id,
+               to_nick_name,
+               to_avatar,
+               content_id,
+               comment_content,
+               del_flag,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from comment_index
+    </sql>
+
+    <select id="selectCommentIndexList" parameterType="CommentIndex" resultMap="CommentIndexResult">
+        <include refid="selectCommentIndexVo"/>
+        <where>
+            <if test="communityId != null ">and community_id = #{communityId}</if>
+            <if test="communityType != null  and communityType != ''">and community_type = #{communityType}</if>
+            <if test="isRoot != null ">and is_root = #{isRoot}</if>
+            <if test="parentId != null ">and parent_id = #{parentId}</if>
+            <if test="userId != null ">and user_id = #{userId}</if>
+            <if test="nickName != null  and nickName != ''">and nick_name like concat('%', #{nickName}, '%')</if>
+            <if test="avatar != null  and avatar != ''">and avatar = #{avatar}</if>
+            <if test="toUserId != null ">and to_user_id = #{toUserId}</if>
+            <if test="toNickName != null  and toNickName != ''">and to_nick_name like concat('%', #{toNickName}, '%')
+            </if>
+            <if test="toAvatar != null  and toAvatar != ''">and to_avatar = #{toAvatar}</if>
+            <if test="contentId != null ">and content_id = #{contentId}</if>
+            <if test="commentContent != null  and commentContent != ''">and comment_content = #{commentContent}</if>
+        </where>
+    </select>
+
+    <select id="selectCommentIndexByCommentId" parameterType="Long" resultMap="CommentIndexResult">
+        <include refid="selectCommentIndexVo"/>
+        where comment_id = #{commentId}
+    </select>
+
+    <select id="getAllComment" parameterType="CommentIndex" resultMap="CommentIndexVoResult">
+        SELECT
+            i.comment_id AS ci_id,
+            i.create_time AS ci_create_time,
+            c.comment_content AS ci_content,
+            children.cu_id AS cu_id,
+            children.cu_nick_name AS cu_nickName,
+            children.cu_avatar AS cu_avatar,
+            children.cl_create_time AS cl_create_time,
+            children.ta_id AS tu_id,
+            children.ta_nick_name AS tu_nickName,
+            children.ta_avatar AS tu_avatar,
+            children.tu_create_time AS tu_create_time,
+            children.c_content AS cl_content
+        FROM
+            comment_index i
+                LEFT JOIN comment_content c ON i.content_id = c.content_id
+                LEFT JOIN (
+                SELECT
+                    i.community_id AS ci_id,
+                    i.parent_id AS ci_parent_id,
+                    i.user_id AS cu_id,
+                    i.nick_name AS cu_nick_name,
+                    i.avatar AS cu_avatar,
+                    i.to_user_id AS ta_id,
+                    i.to_nick_name AS ta_nick_name,
+                    i.to_avatar AS ta_avatar,
+                    i.create_time AS cl_create_time,
+                    i.create_time AS tu_create_time,
+                    c.comment_content AS c_content
+                FROM
+                    comment_index i
+                        LEFT JOIN comment_content c ON i.content_id = c.content_id
+                WHERE
+                    c.STATUS = '2'
+                  AND i.is_root = 2
+                  AND c.del_flag = 'N'
+                  AND i.del_flag = 'N'
+            ) AS children ON children.ci_parent_id = i.comment_id
+        WHERE
+            c.STATUS = '2'
+          AND i.is_root = 1
+          AND c.del_flag = 'N'
+          AND i.del_flag = 'N'
+    </select>
+
+    <insert id="insertCommentIndex" parameterType="CommentIndex" useGeneratedKeys="true" keyProperty="commentId">
+        insert into comment_index
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="communityId != null">community_id,</if>
+            <if test="communityType != null and communityType != ''">community_type,</if>
+            <if test="isRoot != null">is_root,</if>
+            <if test="parentId != null">parent_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="nickName != null">nick_name,</if>
+            <if test="avatar != null">avatar,</if>
+            <if test="toUserId != null">to_user_id,</if>
+            <if test="toNickName != null">to_nick_name,</if>
+            <if test="toAvatar != null">to_avatar,</if>
+            <if test="contentId != null">content_id,</if>
+            <if test="commentContent != null">comment_content,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="communityId != null">#{communityId},</if>
+            <if test="communityType != null and communityType != ''">#{communityType},</if>
+            <if test="isRoot != null">#{isRoot},</if>
+            <if test="parentId != null">#{parentId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="nickName != null">#{nickName},</if>
+            <if test="avatar != null">#{avatar},</if>
+            <if test="toUserId != null">#{toUserId},</if>
+            <if test="toNickName != null">#{toNickName},</if>
+            <if test="toAvatar != null">#{toAvatar},</if>
+            <if test="contentId != null">#{contentId},</if>
+            <if test="commentContent != null">#{commentContent},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCommentIndex" parameterType="CommentIndex">
+        update comment_index
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="communityId != null">community_id = #{communityId},</if>
+            <if test="communityType != null and communityType != ''">community_type = #{communityType},</if>
+            <if test="isRoot != null">is_root = #{isRoot},</if>
+            <if test="parentId != null">parent_id = #{parentId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="nickName != null">nick_name = #{nickName},</if>
+            <if test="avatar != null">avatar = #{avatar},</if>
+            <if test="toUserId != null">to_user_id = #{toUserId},</if>
+            <if test="toNickName != null">to_nick_name = #{toNickName},</if>
+            <if test="toAvatar != null">to_avatar = #{toAvatar},</if>
+            <if test="contentId != null">content_id = #{contentId},</if>
+            <if test="commentContent != null">comment_content = #{commentContent},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where comment_id = #{commentId}
+    </update>
+
+    <delete id="deleteCommentIndexByCommentId" parameterType="Long">
+        delete
+        from comment_index
+        where comment_id = #{commentId}
+    </delete>
+    <update id="updateCommentIndexByCommentId" parameterType="CommentIndex">
+        update set delFlag = 'Y'
+        from comment_index
+        where comment_id = #{commentId}
+    </update>
+    <update id="updateCommentIndexByParentId" parameterType="CommentIndex">
+        update set delFlag = 'Y'
+        from comment_index
+        where parent_id = #{commentId}
+    </update>
+
+    <delete id="deleteCommentIndexByCommentIds" parameterType="String">
+        delete from comment_index where comment_id in
+        <foreach item="commentId" collection="array" open="(" separator="," close=")">
+            #{commentId}
+        </foreach>
+    </delete>
+</mapper>

+ 100 - 0
ruoyi-system/src/main/resources/mapper/system/CommentLikesMapper.xml

@@ -0,0 +1,100 @@
+<?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.ruoyi.system.mapper.CommentLikesMapper">
+    
+    <resultMap type="CommentLikes" id="CommentLikesResult">
+        <result property="likesId"    column="likes_id"    />
+        <result property="targetId"    column="target_id"    />
+        <result property="targetType"    column="target_type"    />
+        <result property="userId"    column="user_id"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="avatar"    column="avatar"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectCommentLikesVo">
+        select likes_id, target_id, target_type, user_id, nick_name, avatar, del_flag, create_by, create_time, update_by, update_time, remark from comment_likes
+    </sql>
+
+    <select id="selectCommentLikesList" parameterType="CommentLikes" resultMap="CommentLikesResult">
+        <include refid="selectCommentLikesVo"/>
+        <where>  
+            <if test="targetId != null "> and target_id = #{targetId}</if>
+            <if test="targetType != null  and targetType != ''"> and target_type = #{targetType}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="nickName != null  and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
+            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
+        </where>
+    </select>
+    
+    <select id="selectCommentLikesByLikesId" parameterType="Long" resultMap="CommentLikesResult">
+        <include refid="selectCommentLikesVo"/>
+        where likes_id = #{likesId}
+    </select>
+
+    <insert id="insertCommentLikes" parameterType="CommentLikes" useGeneratedKeys="true" keyProperty="likesId">
+        insert into comment_likes
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="targetId != null">target_id,</if>
+            <if test="targetType != null">target_type,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="nickName != null">nick_name,</if>
+            <if test="avatar != null">avatar,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="targetId != null">#{targetId},</if>
+            <if test="targetType != null">#{targetType},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="nickName != null">#{nickName},</if>
+            <if test="avatar != null">#{avatar},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCommentLikes" parameterType="CommentLikes">
+        update comment_likes
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="targetId != null">target_id = #{targetId},</if>
+            <if test="targetType != null">target_type = #{targetType},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="nickName != null">nick_name = #{nickName},</if>
+            <if test="avatar != null">avatar = #{avatar},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where likes_id = #{likesId}
+    </update>
+
+    <delete id="deleteCommentLikesByLikesId" parameterType="Long">
+        delete from comment_likes where likes_id = #{likesId}
+    </delete>
+
+    <delete id="deleteCommentLikesByLikesIds" parameterType="String">
+        delete from comment_likes where likes_id in 
+        <foreach item="likesId" collection="array" open="(" separator="," close=")">
+            #{likesId}
+        </foreach>
+    </delete>
+</mapper>

+ 100 - 0
ruoyi-system/src/main/resources/mapper/system/CommentStarsMapper.xml

@@ -0,0 +1,100 @@
+<?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.ruoyi.system.mapper.CommentStarsMapper">
+    
+    <resultMap type="CommentStars" id="CommentStarsResult">
+        <result property="starsId"    column="stars_id"    />
+        <result property="communityId"    column="community_id"    />
+        <result property="communityType"    column="community_type"    />
+        <result property="userId"    column="user_id"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="avatar"    column="avatar"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectCommentStarsVo">
+        select stars_id, community_id, community_type, user_id, nick_name, avatar, del_flag, create_by, create_time, update_by, update_time, remark from comment_stars
+    </sql>
+
+    <select id="selectCommentStarsList" parameterType="CommentStars" resultMap="CommentStarsResult">
+        <include refid="selectCommentStarsVo"/>
+        <where>  
+            <if test="communityId != null "> and community_id = #{communityId}</if>
+            <if test="communityType != null  and communityType != ''"> and community_type = #{communityType}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="nickName != null  and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
+            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
+        </where>
+    </select>
+    
+    <select id="selectCommentStarsByStarsId" parameterType="Long" resultMap="CommentStarsResult">
+        <include refid="selectCommentStarsVo"/>
+        where stars_id = #{starsId}
+    </select>
+
+    <insert id="insertCommentStars" parameterType="CommentStars" useGeneratedKeys="true" keyProperty="starsId">
+        insert into comment_stars
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="communityId != null">community_id,</if>
+            <if test="communityType != null and communityType != ''">community_type,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="nickName != null">nick_name,</if>
+            <if test="avatar != null">avatar,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="communityId != null">#{communityId},</if>
+            <if test="communityType != null and communityType != ''">#{communityType},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="nickName != null">#{nickName},</if>
+            <if test="avatar != null">#{avatar},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCommentStars" parameterType="CommentStars">
+        update comment_stars
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="communityId != null">community_id = #{communityId},</if>
+            <if test="communityType != null and communityType != ''">community_type = #{communityType},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="nickName != null">nick_name = #{nickName},</if>
+            <if test="avatar != null">avatar = #{avatar},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where stars_id = #{starsId}
+    </update>
+
+    <delete id="deleteCommentStarsByStarsId" parameterType="Long">
+        delete from comment_stars where stars_id = #{starsId}
+    </delete>
+
+    <delete id="deleteCommentStarsByStarsIds" parameterType="String">
+        delete from comment_stars where stars_id in 
+        <foreach item="starsId" collection="array" open="(" separator="," close=")">
+            #{starsId}
+        </foreach>
+    </delete>
+</mapper>

+ 31 - 1
ruoyi-system/src/main/resources/mapper/system/CommunityNewsMapper.xml

@@ -11,11 +11,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="communityContent"    column="community_content"    />
         <result property="status"    column="status"    />
         <result property="publishTime"    column="publish_time"    />
+        <result property="userId"    column="user_id"    />
+        <result property="staffId"    column="staff_id"    />
+        <result property="staffName"    column="staff_name"    />
         <result property="author"    column="author"    />
         <result property="source"    column="source"    />
         <result property="coverImage"    column="cover_image"    />
         <result property="viewCount"    column="view_count"    />
         <result property="isTop"    column="is_top"    />
+        <result property="userComment"    column="user_comment"    />
+        <result property="userLikes"    column="user_likes"    />
+        <result property="userStars"    column="user_stars"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -24,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectCommunityNewsVo">
-        select community_id, community_title, community_type, community_content, status, publish_time, author, source, cover_image, view_count, is_top, create_by, create_time, update_by, update_time, remark from community_news
+        select community_id, community_title, community_type, community_content, status, publish_time, user_id, staff_id, staff_name, author, source, cover_image, view_count, is_top, user_comment, user_likes, user_stars, create_by, create_time, update_by, update_time, remark from community_news
     </sql>
 
     <select id="selectCommunityNewsList" parameterType="CommunityNews" resultMap="CommunityNewsResult">
@@ -35,11 +41,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="communityContent != null  and communityContent != ''"> and community_content = #{communityContent}</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="publishTime != null "> and publish_time = #{publishTime}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="staffId != null "> and staff_id = #{staffId}</if>
+            <if test="staffName != null  and staffName != ''"> and staff_name like concat('%', #{staffName}, '%')</if>
             <if test="author != null  and author != ''"> and author = #{author}</if>
             <if test="source != null  and source != ''"> and source = #{source}</if>
             <if test="coverImage != null  and coverImage != ''"> and cover_image = #{coverImage}</if>
             <if test="viewCount != null "> and view_count = #{viewCount}</if>
             <if test="isTop != null  and isTop != ''"> and is_top = #{isTop}</if>
+            <if test="userComment != null  and userComment != ''"> and user_comment = #{userComment}</if>
+            <if test="userLikes != null  and userLikes != ''"> and user_likes = #{userLikes}</if>
+            <if test="userStars != null  and userStars != ''"> and user_stars = #{userStars}</if>
         </where>
     </select>
     
@@ -56,11 +68,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="communityContent != null">community_content,</if>
             <if test="status != null">status,</if>
             <if test="publishTime != null">publish_time,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="staffId != null">staff_id,</if>
+            <if test="staffName != null">staff_name,</if>
             <if test="author != null">author,</if>
             <if test="source != null">source,</if>
             <if test="coverImage != null">cover_image,</if>
             <if test="viewCount != null">view_count,</if>
             <if test="isTop != null">is_top,</if>
+            <if test="userComment != null">user_comment,</if>
+            <if test="userLikes != null">user_likes,</if>
+            <if test="userStars != null">user_stars,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -73,11 +91,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="communityContent != null">#{communityContent},</if>
             <if test="status != null">#{status},</if>
             <if test="publishTime != null">#{publishTime},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="staffId != null">#{staffId},</if>
+            <if test="staffName != null">#{staffName},</if>
             <if test="author != null">#{author},</if>
             <if test="source != null">#{source},</if>
             <if test="coverImage != null">#{coverImage},</if>
             <if test="viewCount != null">#{viewCount},</if>
             <if test="isTop != null">#{isTop},</if>
+            <if test="userComment != null">#{userComment},</if>
+            <if test="userLikes != null">#{userLikes},</if>
+            <if test="userStars != null">#{userStars},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -94,11 +118,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="communityContent != null">community_content = #{communityContent},</if>
             <if test="status != null">status = #{status},</if>
             <if test="publishTime != null">publish_time = #{publishTime},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="staffId != null">staff_id = #{staffId},</if>
+            <if test="staffName != null">staff_name = #{staffName},</if>
             <if test="author != null">author = #{author},</if>
             <if test="source != null">source = #{source},</if>
             <if test="coverImage != null">cover_image = #{coverImage},</if>
             <if test="viewCount != null">view_count = #{viewCount},</if>
             <if test="isTop != null">is_top = #{isTop},</if>
+            <if test="userComment != null">user_comment = #{userComment},</if>
+            <if test="userLikes != null">user_likes = #{userLikes},</if>
+            <if test="userStars != null">user_stars = #{userStars},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>