一、菜单设计
在系统管理-菜单管理中可以设置内容管理菜单(自动生成)
注意:归属模块应属于核心模块core。如果新加的的菜单设置为内容管理模块cms,系统下次重启时会重置本次设置,具体原因不详。
二、数据库设计:
js_cms_articles;js_cms_comments;js_cms_tags;js_cms_categories再加上两个中间表js_cms_articles_categories;js_cms_articles_tags
DROP TABLE IF EXISTS `js_cms_articles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles` (
`id` bigint(100) NOT NULL,
`create_at` timestamp NULL DEFAULT NULL,
`update_at` timestamp NULL DEFAULT NULL,
`delete_at` timestamp NULL DEFAULT NULL,
`author_id` bigint(100) DEFAULT NULL,
`title` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`tags` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
`path` varchar(30) COLLATE utf8_bin DEFAULT NULL,
`view_count` int(11) DEFAULT NULL,
`comment_count` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_articles_categories`
-- DROP TABLE IF EXISTS `js_cms_articles_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles_categories` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`category_code` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000011 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_articles_tags`
-- DROP TABLE IF EXISTS `js_cms_articles_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles_tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`tag_code` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20000011 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_articles_tags`
-- DROP TABLE IF EXISTS `js_cms_articles_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles_tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`tag_code` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20000011 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_categories`
-- DROP TABLE IF EXISTS `js_cms_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_categories` (
`c_code` int(10) NOT NULL AUTO_INCREMENT,
`c_title` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
PRIMARY KEY (`c_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_comments`
-- DROP TABLE IF EXISTS `js_cms_comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_comments` (
`id` bigint(20) NOT NULL,
`create_at` timestamp NULL DEFAULT NULL,
`update_at` timestamp NULL DEFAULT NULL,
`delete_at` timestamp NULL DEFAULT NULL,
`article_id` bigint(20) DEFAULT NULL,
`author_id` bigint(20) DEFAULT NULL,
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
`parent_comment_id` mediumtext COLLATE utf8_bin,
`building` int(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_tags`
-- DROP TABLE IF EXISTS `js_cms_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_tags` (
`t_code` int(10) NOT NULL AUTO_INCREMENT,
`t_title` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`t_code`)
) ENGINE=InnoDB AUTO_INCREMENT=2008 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `js_cms_articles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles` (
`id` bigint(100) NOT NULL,
`create_at` timestamp NULL DEFAULT NULL,
`update_at` timestamp NULL DEFAULT NULL,
`delete_at` timestamp NULL DEFAULT NULL,
`author_id` bigint(100) DEFAULT NULL,
`title` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`tags` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
`path` varchar(30) COLLATE utf8_bin DEFAULT NULL,
`view_count` int(11) DEFAULT NULL,
`comment_count` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_articles_categories`
-- DROP TABLE IF EXISTS `js_cms_articles_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles_categories` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`category_code` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000011 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_articles_tags`
-- DROP TABLE IF EXISTS `js_cms_articles_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles_tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`tag_code` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20000011 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_articles_tags`
-- DROP TABLE IF EXISTS `js_cms_articles_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_articles_tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) DEFAULT NULL,
`tag_code` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20000011 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_categories`
-- DROP TABLE IF EXISTS `js_cms_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_categories` (
`c_code` int(10) NOT NULL AUTO_INCREMENT,
`c_title` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
PRIMARY KEY (`c_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_comments`
-- DROP TABLE IF EXISTS `js_cms_comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_comments` (
`id` bigint(20) NOT NULL,
`create_at` timestamp NULL DEFAULT NULL,
`update_at` timestamp NULL DEFAULT NULL,
`delete_at` timestamp NULL DEFAULT NULL,
`article_id` bigint(20) DEFAULT NULL,
`author_id` bigint(20) DEFAULT NULL,
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
`parent_comment_id` mediumtext COLLATE utf8_bin,
`building` int(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; --
-- Table structure for table `js_cms_tags`
-- DROP TABLE IF EXISTS `js_cms_tags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `js_cms_tags` (
`t_code` int(10) NOT NULL AUTO_INCREMENT,
`t_title` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`t_code`)
) ENGINE=InnoDB AUTO_INCREMENT=2008 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
三、代码设计:
common是一些公共的方法和组件,例如全局异常,搜索组件
modules是我们的cms模块和它给的Demo(test模块)
static.common下放的前端css和js等静态资源
view.modules下是demo的html文件;view.templates下是cms的html文件
views.themes.default.modules.sys.sysIndex.topMenuCorp.html:拷贝自jeesite-core(系统核心jar包),对原来内容进行覆盖修改(路径不能变)
jeesite:beetl是后端模版引擎相关配置jar包
jeesite-common是系统公共工具类集成jar包
jeesite-framework是系统各模块jar包
jeesite-core是系统核心管理框架jar包
jeesite-swagger是系统API管理工具配置jar包