CommentContentServiceImpl.java 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package com.ruoyi.system.service.impl;
  2. import com.ruoyi.common.utils.DateUtils;
  3. import com.ruoyi.system.domain.communityNews.CommentContent;
  4. import com.ruoyi.system.mapper.CommentContentMapper;
  5. import com.ruoyi.system.service.ICommentContentService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Service;
  8. import java.util.List;
  9. /**
  10. * 社区资讯评论内容Service业务层处理
  11. *
  12. * @author boman
  13. * @date 2025-02-25
  14. */
  15. @Service
  16. public class CommentContentServiceImpl implements ICommentContentService
  17. {
  18. @Autowired
  19. private CommentContentMapper commentContentMapper;
  20. /**
  21. * 查询社区资讯评论内容
  22. *
  23. * @param contentId 社区资讯评论内容主键
  24. * @return 社区资讯评论内容
  25. */
  26. @Override
  27. public CommentContent selectCommentContentByContentId(Long contentId)
  28. {
  29. return commentContentMapper.selectCommentContentByContentId(contentId);
  30. }
  31. /**
  32. * 查询社区资讯评论内容列表
  33. *
  34. * @param commentContent 社区资讯评论内容
  35. * @return 社区资讯评论内容
  36. */
  37. @Override
  38. public List<CommentContent> selectCommentContentList(CommentContent commentContent)
  39. {
  40. return commentContentMapper.selectCommentContentList(commentContent);
  41. }
  42. /**
  43. * 新增社区资讯评论内容
  44. *
  45. * @param commentContent 社区资讯评论内容
  46. * @return 结果
  47. */
  48. @Override
  49. public int insertCommentContent(CommentContent commentContent)
  50. {
  51. commentContent.setCreateTime(DateUtils.getNowDate());
  52. return commentContentMapper.insertCommentContent(commentContent);
  53. }
  54. /**
  55. * 修改社区资讯评论内容
  56. *
  57. * @param commentContent 社区资讯评论内容
  58. * @return 结果
  59. */
  60. @Override
  61. public int updateCommentContent(CommentContent commentContent)
  62. {
  63. commentContent.setUpdateTime(DateUtils.getNowDate());
  64. return commentContentMapper.updateCommentContent(commentContent);
  65. }
  66. /**
  67. * 批量删除社区资讯评论内容
  68. *
  69. * @param contentIds 需要删除的社区资讯评论内容主键
  70. * @return 结果
  71. */
  72. @Override
  73. public int deleteCommentContentByContentIds(Long[] contentIds)
  74. {
  75. return commentContentMapper.deleteCommentContentByContentIds(contentIds);
  76. }
  77. /**
  78. * 删除社区资讯评论内容信息
  79. *
  80. * @param contentId 社区资讯评论内容主键
  81. * @return 结果
  82. */
  83. @Override
  84. public int deleteCommentContentByContentId(Long contentId)
  85. {
  86. return commentContentMapper.deleteCommentContentByContentId(contentId);
  87. }
  88. }