From 80124a05abb480f64e7016cb8bb838875b137dce Mon Sep 17 00:00:00 2001 From: 123 <123@qq.com> Date: Tue, 29 Apr 2025 14:25:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=90=8E=E5=8F=B0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/mybatisx/templates.xml | 55 ++ .../controller/admin/CommentController.java | 36 ++ .../cms/dao/SystemCommentsMapper.java | 9 +- .../iteachyou/cms/entity/SystemComments.java | 60 ++ .../iteachyou/cms/service/CommentService.java | 16 + .../cms/service/impl/CommentServiceImpl.java | 46 ++ .../mapping/SystemCommentsMapper.xml | 5 + .../templates/admin/comment/add.html | 432 ++++++++++++++ .../templates/admin/comment/edit.html | 541 ++++++++++++++++++ .../templates/admin/comment/list.html | 178 ++++++ 10 files changed, 1376 insertions(+), 2 deletions(-) create mode 100644 .idea/mybatisx/templates.xml create mode 100644 src/main/java/cc/iteachyou/cms/controller/admin/CommentController.java create mode 100644 src/main/java/cc/iteachyou/cms/entity/SystemComments.java create mode 100644 src/main/java/cc/iteachyou/cms/service/CommentService.java create mode 100644 src/main/java/cc/iteachyou/cms/service/impl/CommentServiceImpl.java create mode 100644 src/main/resources/templates/admin/comment/add.html create mode 100644 src/main/resources/templates/admin/comment/edit.html create mode 100644 src/main/resources/templates/admin/comment/list.html diff --git a/.idea/mybatisx/templates.xml b/.idea/mybatisx/templates.xml new file mode 100644 index 0000000..b901b6a --- /dev/null +++ b/.idea/mybatisx/templates.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/cc/iteachyou/cms/controller/admin/CommentController.java b/src/main/java/cc/iteachyou/cms/controller/admin/CommentController.java new file mode 100644 index 0000000..f7c2ee5 --- /dev/null +++ b/src/main/java/cc/iteachyou/cms/controller/admin/CommentController.java @@ -0,0 +1,36 @@ +package cc.iteachyou.cms.controller.admin; + +import cc.iteachyou.cms.annotation.Log; +import cc.iteachyou.cms.annotation.Log.OperatorType; +import cc.iteachyou.cms.common.BaseController; +import cc.iteachyou.cms.common.SearchEntity; +import cc.iteachyou.cms.entity.SystemComments; +import cc.iteachyou.cms.service.CommentService; +import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * 栏目管理 + * + * @author Wangjn + */ +@Controller +@RequestMapping("admin/comment") +public class CommentController extends BaseController { + @Autowired + private CommentService commentService; + + @Log(operType = OperatorType.PAGE, module = "留言", content = "留言") + @RequestMapping({"", "/list"}) +// @RequiresPermissions("system:comment:page") + public String list(Model model, SearchEntity params) { + PageInfo page = commentService.queryListByPage(params); + model.addAttribute("page", page); + return "admin/comment/list"; + } + + +} diff --git a/src/main/java/cc/iteachyou/cms/dao/SystemCommentsMapper.java b/src/main/java/cc/iteachyou/cms/dao/SystemCommentsMapper.java index de23d45..91a021b 100644 --- a/src/main/java/cc/iteachyou/cms/dao/SystemCommentsMapper.java +++ b/src/main/java/cc/iteachyou/cms/dao/SystemCommentsMapper.java @@ -1,11 +1,16 @@ package cc.iteachyou.cms.dao; import cc.iteachyou.cms.common.BaseMapper; -import cc.iteachyou.cms.entity.Archives; +import cc.iteachyou.cms.entity.SystemComments; import cc.iteachyou.cms.entity.ao.CommentAO; import org.apache.ibatis.annotations.Param; -public interface SystemCommentsMapper extends BaseMapper { +import java.util.List; +import java.util.Map; + +public interface SystemCommentsMapper extends BaseMapper { void saveComments(@Param("ao") CommentAO ao); + + List queryListByPage(Map entity); } \ No newline at end of file diff --git a/src/main/java/cc/iteachyou/cms/entity/SystemComments.java b/src/main/java/cc/iteachyou/cms/entity/SystemComments.java new file mode 100644 index 0000000..28a73ac --- /dev/null +++ b/src/main/java/cc/iteachyou/cms/entity/SystemComments.java @@ -0,0 +1,60 @@ +package cc.iteachyou.cms.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @TableName system_comments + */ +@Data +public class SystemComments implements Serializable { + + /** + * + */ + private Long id; + /** + * + */ + + private String name; + /** + * + */ + + private String subject; + /** + * + */ + + private String tel; + /** + * + */ + + private String email; + /** + * + */ + + private String comments; + /** + * + */ + private String createBy; + /** + * + */ + private Date createTime; + /** + * + */ + private String updateBy; + /** + * + */ + private Date updateTime; + +} diff --git a/src/main/java/cc/iteachyou/cms/service/CommentService.java b/src/main/java/cc/iteachyou/cms/service/CommentService.java new file mode 100644 index 0000000..685f4b5 --- /dev/null +++ b/src/main/java/cc/iteachyou/cms/service/CommentService.java @@ -0,0 +1,16 @@ +package cc.iteachyou.cms.service; + +import cc.iteachyou.cms.common.SearchEntity; +import cc.iteachyou.cms.entity.SystemComments; +import com.github.pagehelper.PageInfo; + +import java.util.List; + +public interface CommentService { + + + PageInfo queryListByPage(SearchEntity params); + + List queryAll(); + +} diff --git a/src/main/java/cc/iteachyou/cms/service/impl/CommentServiceImpl.java b/src/main/java/cc/iteachyou/cms/service/impl/CommentServiceImpl.java new file mode 100644 index 0000000..5aebf5e --- /dev/null +++ b/src/main/java/cc/iteachyou/cms/service/impl/CommentServiceImpl.java @@ -0,0 +1,46 @@ +package cc.iteachyou.cms.service.impl; + +import cc.iteachyou.cms.common.SearchEntity; +import cc.iteachyou.cms.dao.SystemCommentsMapper; +import cc.iteachyou.cms.entity.SystemComments; +import cc.iteachyou.cms.service.CommentService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 栏目管理业务类 + * + * @author LIGW + */ +@Service +public class CommentServiceImpl implements CommentService { + @Autowired + private SystemCommentsMapper systemCommentsMapper; + + /** + * 列表 + */ + @Override + public PageInfo queryListByPage(SearchEntity params) { + if (params.getPageNum() == null || params.getPageNum() == 0) { + params.setPageNum(1); + } + if (params.getPageSize() == null || params.getPageSize() == 0) { + params.setPageSize(10); + } + PageHelper.startPage(params.getPageNum(), params.getPageSize()); + List list = systemCommentsMapper.queryListByPage(params.getEntity()); + PageInfo page = new PageInfo(list); + return page; + } + + @Override + public List queryAll() { + return null; + } + +} diff --git a/src/main/resources/mapping/SystemCommentsMapper.xml b/src/main/resources/mapping/SystemCommentsMapper.xml index cb3e7e9..ac1a5a2 100644 --- a/src/main/resources/mapping/SystemCommentsMapper.xml +++ b/src/main/resources/mapping/SystemCommentsMapper.xml @@ -57,4 +57,9 @@ NOW(), NOW()); + + select * + from system_comments + order by create_time desc + \ No newline at end of file diff --git a/src/main/resources/templates/admin/comment/add.html b/src/main/resources/templates/admin/comment/add.html new file mode 100644 index 0000000..044d512 --- /dev/null +++ b/src/main/resources/templates/admin/comment/add.html @@ -0,0 +1,432 @@ + + + + + + Dreamer CMS - 后台管理系统 + + + + + + + + + + + + + + + + + 发布文章 + + + 首页 + + 发布文章 + + + + + + + + + + + + + 文章标题: + + + + 权重: + + + + 点击: + + + + 自定义属性: + + 头条[h] + + + 加粗[b] + + + 幻灯[f] + + + 图片[p] + + + + 缩略图: + + + + + 选择文件... + + 清除 + + + + + + 所属栏目: + + + + 标签: + + + + 内容摘要: + + + + + + + + + + + + + + + + + + + + 选择文件... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 选择文件... + + + + + + + + 选择文件... + 开始上传 + + + + + + 允许评论: + + 是 + + + 否 + + + + 允许订阅: + + 是 + + + 否 + + + + 发布状态: + + 已发布 + + + 未发布 + + + + + + 保存 + 取消 + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/admin/comment/edit.html b/src/main/resources/templates/admin/comment/edit.html new file mode 100644 index 0000000..948c0f5 --- /dev/null +++ b/src/main/resources/templates/admin/comment/edit.html @@ -0,0 +1,541 @@ + + + + + + Dreamer CMS - 后台管理系统 + + + + + + + + + + + + + + + + + + 编辑文章 + + + 首页 + + 编辑文章 + + + + + + + + + + + + + + + + + + 文章标题: + + + + 权重: + + + + 点击: + + + + 自定义属性: + + 头条[h] + + + 加粗[b] + + + 幻灯[f] + + + 图片[p] + + + + 缩略图: + + + + + + + 选择文件... + + 清除 + + + + + + + 所属栏目: + + + + 标签: + + + + + + 内容摘要: + + + + + + + + + + + + + + + + + + + + + + 选择文件... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 选择文件... + + + + + + + + + 已经上传... + + + + + 选择文件... + 开始上传 + + + + + + + 允许评论: + + 是 + + + 否 + + + + 允许订阅: + + 是 + + + 否 + + + + 发布状态: + + 已发布 + + + + 未发布 + + + + + + 保存 + + 取消 + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/admin/comment/list.html b/src/main/resources/templates/admin/comment/list.html new file mode 100644 index 0000000..7643cfb --- /dev/null +++ b/src/main/resources/templates/admin/comment/list.html @@ -0,0 +1,178 @@ + + + + + + Dreamer CMS - 后台管理系统 + + + + + + + + + + + 留言查看 + + + 首页 + + 留言查看 + + + + + + + + + + + + + + + + 序号 + 姓名 + 标题 + 电话 + email + 内容 + 时间 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 无数据 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
已经上传...