CREATE database if NOT EXISTS `novel_plus` default character set utf8mb4 collate utf8mb4_unicode_ci; use `novel_plus`; SET NAMES utf8mb4; -- ---------------------------- -- Table structure for author -- ---------------------------- DROP TABLE IF EXISTS `author`; CREATE TABLE `author` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', `invite_code` varchar(20) DEFAULT NULL COMMENT '邀请码', `pen_name` varchar(20) DEFAULT NULL COMMENT '笔名', `tel_phone` varchar(20) DEFAULT NULL COMMENT '手机号码', `chat_account` varchar(50) DEFAULT NULL COMMENT 'QQ或微信账号', `email` varchar(50) DEFAULT NULL COMMENT '电子邮箱', `work_direction` tinyint(4) DEFAULT NULL COMMENT '作品方向,0:男频,1:女频', `status` tinyint(4) DEFAULT '0' COMMENT '0:正常,1:封禁', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COMMENT ='作者表'; -- ---------------------------- -- Records of author -- ---------------------------- INSERT INTO `author` VALUES ('1', null, 'reerer', 'abc', '13560487656', '23484388', '23484388@qq.com', '0', '0', null); INSERT INTO `author` VALUES ('2', '1255060328322027520', 'rwrr445554', '梦入神机', '13560421324', '1179705413', 'reerer@qq.com', '0', '0', '2020-05-13 14:01:31'); -- ---------------------------- -- Table structure for author_code -- ---------------------------- DROP TABLE IF EXISTS `author_code`; CREATE TABLE `author_code` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `invite_code` varchar(100) DEFAULT NULL COMMENT '邀请码', `validity_time` datetime DEFAULT NULL COMMENT '有效时间', `is_use` tinyint(1) DEFAULT '0' COMMENT '是否使用过,0:未使用,1:使用过', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建人ID', PRIMARY KEY (`id`), UNIQUE KEY `key_code` (`invite_code`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 DEFAULT CHARSET = utf8mb4 COMMENT ='作家邀请码表'; -- ---------------------------- -- Records of author_code -- ---------------------------- INSERT INTO `author_code` VALUES ('3', 'reerer', '2020-05-27 22:43:45', '1', '2020-05-13 11:40:56', '1'); INSERT INTO `author_code` VALUES ('4', '123456', '2020-05-28 00:00:00', '0', '2020-05-13 14:09:55', '1'); INSERT INTO `author_code` VALUES ('5', 'ww34343', '2020-05-21 00:00:00', '0', '2020-05-13 14:18:58', '1'); -- ---------------------------- -- Table structure for book -- ---------------------------- DROP TABLE IF EXISTS `book`; CREATE TABLE `book` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `work_direction` tinyint(1) DEFAULT NULL COMMENT '作品方向,0:男频,1:女频''', `cat_id` int(11) DEFAULT NULL COMMENT '分类ID', `cat_name` varchar(50) DEFAULT NULL COMMENT '分类名', `pic_url` varchar(200) NOT NULL COMMENT '小说封面', `book_name` varchar(50) NOT NULL COMMENT '小说名', `author_id` bigint(20) DEFAULT NULL COMMENT '作者id', `author_name` varchar(50) NOT NULL COMMENT '作者名', `book_desc` varchar(2000) NOT NULL COMMENT '书籍描述', `score` float NOT NULL COMMENT '评分,预留字段', `book_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '书籍状态,0:连载中,1:已完结', `visit_count` bigint(20) DEFAULT '103' COMMENT '点击量', `word_count` int(11) DEFAULT NULL COMMENT '总字数', `comment_count` int(11) DEFAULT '0' COMMENT '评论数', `last_index_id` bigint(20) DEFAULT NULL COMMENT '最新目录ID', `last_index_name` varchar(50) DEFAULT NULL COMMENT '最新目录名', `last_index_update_time` datetime DEFAULT NULL COMMENT '最新目录更新时间', `is_vip` tinyint(1) DEFAULT '0' COMMENT '是否收费,1:收费,0:免费', `status` tinyint(1) DEFAULT '0' COMMENT '状态,0:入库,1:上架', `update_time` datetime NOT NULL COMMENT '更新时间', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `crawl_source_id` int(11) DEFAULT NULL COMMENT '爬虫源站ID', `crawl_book_id` varchar(32) DEFAULT NULL COMMENT '抓取的源站小说ID', `crawl_last_time` datetime DEFAULT NULL COMMENT '最后一次的抓取时间', `crawl_is_stop` tinyint(1) DEFAULT '0' COMMENT '是否已停止更新,0:未停止,1:已停止', PRIMARY KEY (`id`), UNIQUE KEY `key_uq_bookName_authorName` (`book_name`, `author_name`) USING BTREE, KEY `key_lastIndexUpdateTime` (`last_index_update_time`) USING BTREE, KEY `key_createTime` (`create_time`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1262260513468559361 DEFAULT CHARSET = utf8mb4 COMMENT ='小说表'; -- ---------------------------- -- Records of book -- ---------------------------- -- ---------------------------- -- Table structure for book_author -- ---------------------------- DROP TABLE IF EXISTS `book_author`; CREATE TABLE `book_author` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `invite_code` varchar(20) DEFAULT NULL COMMENT '邀请码', `pen_name` varchar(20) DEFAULT NULL COMMENT '笔名', `tel_phone` varchar(20) DEFAULT NULL COMMENT '手机号码', `chat_account` varchar(50) DEFAULT NULL COMMENT 'QQ或微信账号', `email` varchar(50) DEFAULT NULL COMMENT '电子邮箱', `work_direction` tinyint(4) DEFAULT NULL COMMENT '作品方向,0:男频,1:女频', `status` tinyint(4) DEFAULT NULL COMMENT '0:待审核,1:审核通过,正常,2:审核不通过', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `create_user_id` bigint(20) DEFAULT NULL COMMENT '申请人ID', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_user_id` bigint(20) DEFAULT NULL COMMENT '更新人ID', PRIMARY KEY (`id`) ) ENGINE = InnoDB AUTO_INCREMENT = 1254957873655066625 DEFAULT CHARSET = utf8mb4 COMMENT ='作者表'; -- ---------------------------- -- Records of book_author -- ---------------------------- -- ---------------------------- -- Table structure for book_category -- ---------------------------- DROP TABLE IF EXISTS `book_category`; CREATE TABLE `book_category` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `work_direction` tinyint(1) DEFAULT NULL COMMENT '作品方向,0:男频,1:女频''', `name` varchar(20) NOT NULL COMMENT '分类名', `sort` tinyint(4) NOT NULL DEFAULT '10' COMMENT '排序', `create_user_id` bigint(20) DEFAULT NULL, `create_time` datetime DEFAULT NULL, `update_user_id` bigint(20) DEFAULT NULL, `update_time` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE = InnoDB AUTO_INCREMENT = 8 DEFAULT CHARSET = utf8mb4 COMMENT ='小说类别表'; -- ---------------------------- -- Records of book_category -- ---------------------------- INSERT INTO `book_category` VALUES ('1', '0', '玄幻奇幻', '10', null, null, null, null); INSERT INTO `book_category` VALUES ('2', '0', '武侠仙侠', '11', null, null, null, null); INSERT INTO `book_category` VALUES ('3', '0', '都市言情', '12', null, null, null, null); INSERT INTO `book_category` VALUES ('4', '0', '历史军事', '13', null, null, null, null); INSERT INTO `book_category` VALUES ('5', '0', '科幻灵异', '14', null, null, null, null); INSERT INTO `book_category` VALUES ('6', '0', '网游竞技', '15', null, null, null, null); INSERT INTO `book_category` VALUES ('7', '1', '女生频道', '16', null, null, null, null); -- ---------------------------- -- Table structure for book_comment -- ---------------------------- DROP TABLE IF EXISTS `book_comment`; CREATE TABLE `book_comment` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `book_id` bigint(20) DEFAULT NULL COMMENT '小说ID', `comment_content` varchar(512) DEFAULT NULL COMMENT '评价内容', `reply_count` int(11) DEFAULT '0' COMMENT '回复数量', `audit_status` tinyint(1) DEFAULT '0' COMMENT '审核状态,0:待审核,1:审核通过,2:审核不通过', `create_time` datetime DEFAULT NULL COMMENT '评价时间', `create_user_id` bigint(20) DEFAULT NULL COMMENT '评价人', PRIMARY KEY (`id`), UNIQUE KEY `key_uq_bookid_userid` (`book_id`, `create_user_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 13 DEFAULT CHARSET = utf8mb4 COMMENT ='小说评论表'; -- ---------------------------- -- Records of book_comment -- ---------------------------- INSERT INTO `book_comment` VALUES ('11', '1254678892443795456', '好书呀,值得一看', '0', '0', '2020-04-28 17:04:56', '1255060328322027520'); INSERT INTO `book_comment` VALUES ('12', '1254954626689150976', 'ffgfgfffffffffff', '0', '0', '2020-04-30 08:35:53', '1255060328322027520'); -- ---------------------------- -- Table structure for book_comment_reply -- ---------------------------- DROP TABLE IF EXISTS `book_comment_reply`; CREATE TABLE `book_comment_reply` ( `id` bigint(20) NOT NULL COMMENT '主键', `comment_id` bigint(20) DEFAULT NULL COMMENT '评论ID', `reply_content` varchar(512) DEFAULT NULL COMMENT '回复内容', `audit_status` tinyint(1) DEFAULT '0' COMMENT '审核状态,0:待审核,1:审核通过,2:审核不通过', `create_time` datetime DEFAULT NULL COMMENT '回复用户ID', `create_user_id` bigint(20) DEFAULT NULL COMMENT '回复时间', PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='小说评论回复表'; -- ---------------------------- -- Records of book_comment_reply -- ---------------------------- -- ---------------------------- -- Table structure for book_content -- ---------------------------- DROP TABLE IF EXISTS `book_content`; CREATE TABLE `book_content` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `index_id` bigint(20) DEFAULT NULL COMMENT '目录ID', `content` mediumtext COMMENT '小说章节内容', PRIMARY KEY (`id`), UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3347665 DEFAULT CHARSET = utf8mb4 COMMENT ='小说内容表'; -- ---------------------------- -- Records of book_content -- ---------------------------- -- ---------------------------- -- Table structure for book_index -- ---------------------------- DROP TABLE IF EXISTS `book_index`; CREATE TABLE `book_index` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `book_id` bigint(20) NOT NULL COMMENT '小说ID', `index_num` int(11) NOT NULL COMMENT '目录号', `index_name` varchar(100) DEFAULT NULL COMMENT '目录名', `word_count` int(11) DEFAULT NULL COMMENT '字数', `is_vip` tinyint(4) DEFAULT '0' COMMENT '是否收费,1:收费,0:免费', `create_time` datetime DEFAULT NULL, `update_time` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `key_uq_bookId_indexNum` (`book_id`, `index_num`) USING BTREE, KEY `key_bookId` (`book_id`) USING BTREE, KEY `key_indexNum` (`index_num`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1262260612777095169 DEFAULT CHARSET = utf8mb4 COMMENT ='小说目录表'; -- ---------------------------- -- Records of book_index -- ---------------------------- -- ---------------------------- -- Table structure for book_screen_bullet -- ---------------------------- DROP TABLE IF EXISTS `book_screen_bullet`; CREATE TABLE `book_screen_bullet` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `content_id` bigint(20) NOT NULL COMMENT '小说内容ID', `screen_bullet` varchar(512) NOT NULL COMMENT '小说弹幕内容', `create_time` datetime NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`), KEY `key_contentId` (`content_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 79 DEFAULT CHARSET = utf8mb4 COMMENT ='小说弹幕表'; -- ---------------------------- -- Records of book_screen_bullet -- ---------------------------- -- ---------------------------- -- Table structure for book_setting -- ---------------------------- DROP TABLE IF EXISTS `book_setting`; CREATE TABLE `book_setting` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `book_id` bigint(20) DEFAULT NULL COMMENT '小说ID', `sort` tinyint(4) DEFAULT NULL COMMENT '排序号', `type` tinyint(1) DEFAULT NULL COMMENT '类型,0:轮播图,1:顶部小说栏设置,2:本周强推,3:热门推荐,4:精品推荐', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建人ID', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_user_id` bigint(20) DEFAULT NULL COMMENT '更新人ID', PRIMARY KEY (`id`) ) ENGINE = InnoDB AUTO_INCREMENT = 64 DEFAULT CHARSET = utf8mb4 COMMENT ='首页小说设置表'; -- ---------------------------- -- Records of book_setting -- ---------------------------- INSERT INTO `book_setting` VALUES ('32', '1254674114481422336', '1', '0', '2020-04-27 15:45:58', null, '2020-04-27 15:46:03', null); INSERT INTO `book_setting` VALUES ('33', '1254674171310047232', '2', '0', '2020-04-27 15:46:21', null, '2020-04-27 15:46:24', null); INSERT INTO `book_setting` VALUES ('34', '1254674255883993088', '3', '0', '2020-04-27 15:47:06', null, '2020-04-27 15:47:09', null); INSERT INTO `book_setting` VALUES ('35', '1254674396451897344', '4', '0', '2020-04-27 15:47:24', null, '2020-04-27 15:47:27', null); INSERT INTO `book_setting` VALUES ('36', '1254674613117059072', '1', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('37', '1254680030366859264', '2', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('38', '1254677251162308608', '3', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('39', '1254677745226153984', '4', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('40', '1254677887534694400', '5', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('41', '1254675594315759616', '1', '2', null, null, null, null); INSERT INTO `book_setting` VALUES ('42', '1254675739140882432', '2', '2', null, null, null, null); INSERT INTO `book_setting` VALUES ('43', '1254675826696978432', '3', '2', null, null, null, null); INSERT INTO `book_setting` VALUES ('44', '1254676309448785920', '4', '2', null, null, null, null); INSERT INTO `book_setting` VALUES ('45', '1254676443012202496', '5', '2', null, null, null, null); INSERT INTO `book_setting` VALUES ('46', '1254676564366000128', '6', '2', null, null, null, null); INSERT INTO `book_setting` VALUES ('47', '1254676970567565312', '1', '3', null, null, null, null); INSERT INTO `book_setting` VALUES ('48', '1254677251162308608', '2', '3', null, null, null, null); INSERT INTO `book_setting` VALUES ('49', '1254677745226153984', '3', '3', null, null, null, null); INSERT INTO `book_setting` VALUES ('50', '1254677887534694400', '4', '3', null, null, null, null); INSERT INTO `book_setting` VALUES ('51', '1254675826696978432', '5', '3', null, null, null, null); INSERT INTO `book_setting` VALUES ('52', '1254676970567565312', '6', '3', null, null, null, null); INSERT INTO `book_setting` VALUES ('53', '1254681827219275776', '1', '4', null, null, null, null); INSERT INTO `book_setting` VALUES ('54', '1254681178427555840', '2', '4', null, null, null, null); INSERT INTO `book_setting` VALUES ('55', '1254681827219275776', '3', '4', null, null, null, null); INSERT INTO `book_setting` VALUES ('56', '1254681753466634240', '4', '4', null, null, null, null); INSERT INTO `book_setting` VALUES ('57', '1254682148440047616', '5', '4', null, null, null, null); INSERT INTO `book_setting` VALUES ('58', '1254682422076440576', '6', '4', null, null, null, null); INSERT INTO `book_setting` VALUES ('59', '1254674794009001984', '6', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('60', '1254678892443795456', '7', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('61', '1254681753466634240', '8', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('62', '1254681071191785472', '9', '1', null, null, null, null); INSERT INTO `book_setting` VALUES ('63', '1254677745226153984', '10', '1', null, null, null, null); -- ---------------------------- -- Table structure for crawl_batch_task -- ---------------------------- DROP TABLE IF EXISTS `crawl_batch_task`; CREATE TABLE `crawl_batch_task` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `source_id` int(11) DEFAULT NULL COMMENT '爬虫源ID', `crawl_count_success` int(11) DEFAULT NULL COMMENT '成功抓取数量', `crawl_count_target` int(11) DEFAULT NULL COMMENT '目标抓取数量', `task_status` tinyint(1) DEFAULT '1' COMMENT '任务状态,1:正在运行,0已停止', `start_time` datetime DEFAULT NULL COMMENT '任务开始时间', `end_time` datetime DEFAULT NULL COMMENT '任务结束时间', PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='批量抓取任务表'; -- ---------------------------- -- Records of crawl_batch_task -- ---------------------------- -- ---------------------------- -- Table structure for crawl_single_task -- ---------------------------- DROP TABLE IF EXISTS `crawl_single_task`; CREATE TABLE `crawl_single_task` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `source_id` int(11) DEFAULT NULL COMMENT '爬虫源ID', `source_book_id` varchar(255) DEFAULT NULL COMMENT '源站小说ID', `task_status` tinyint(1) DEFAULT NULL COMMENT '任务状态,0:失败,1:成功,2;未执行', `exc_count` tinyint(2) DEFAULT '0' COMMENT '已经执行次数,最多执行5次', `create_time` datetime DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='抓取单本小说任务表'; -- ---------------------------- -- Records of crawl_single_task -- ---------------------------- -- ---------------------------- -- Table structure for crawl_source -- ---------------------------- DROP TABLE IF EXISTS `crawl_source`; CREATE TABLE `crawl_source` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `source_name` varchar(50) DEFAULT NULL COMMENT '源站名', `crawl_rule` text COMMENT '爬取规则(json串)', `source_status` tinyint(1) DEFAULT '0' COMMENT '爬虫源状态,0:关闭,1:开启', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE = InnoDB AUTO_INCREMENT = 5 DEFAULT CHARSET = utf8mb4 COMMENT ='爬虫源表'; -- ---------------------------- -- Records of crawl_source -- ---------------------------- INSERT INTO `crawl_source` VALUES ('2', '百书斋', '{\r\n \"bookListUrl\": \"https://m.baishuzhai.com/blhb/{catId}/{page}.html\",\r\n \"catIdRule\": {\r\n \"catId1\": \"1\",\r\n \"catId2\": \"2\",\r\n \"catId3\": \"3\",\r\n \"catId4\": \"4\",\r\n \"catId5\": \"5\",\r\n \"catId6\": \"6\",\r\n \"catId7\": \"7\"\r\n },\r\n \"bookIdPatten\": \"href=\\\"/ibook/(\\\\d+/\\\\d+)/\\\"\",\r\n \"pagePatten\": \"value=\\\"(\\\\d+)/\\\\d+\\\"\",\r\n \"totalPagePatten\": \"value=\\\"\\\\d+/(\\\\d+)\\\"\",\r\n \"bookDetailUrl\": \"https://m.baishuzhai.com/ibook/{bookId}/\",\r\n \"bookNamePatten\": \"([^/]+)\",\r\n \"authorNamePatten\": \">作者:([^/]+)<\",\r\n \"picUrlPatten\": \"]+)\\\"\\\\s+onerror=\\\"this.src=\",\r\n \"statusPatten\": \"状态:([^/]+)\",\r\n \"bookStatusRule\": {\r\n \"连载\": 0,\r\n \"完成\": 1\r\n },\r\n \"scorePatten\": \"([^<]+)\",\r\n \"descStart\": \"

\",\r\n \"descEnd\": \"

\",\r\n \"upadateTimePatten\": \"更新:(\\\\d+-\\\\d+-\\\\d+)\",\r\n \"upadateTimeFormatPatten\": \"yy-MM-dd\",\r\n \"bookIndexUrl\": \"https://m.baishuzhai.com/ibook/{bookId}/all.html\",\r\n \"indexIdPatten\": \"[^/]+\",\r\n \"indexNamePatten\": \"([^/]+)\",\r\n \"bookContentUrl\": \"https://baishuzhai.com/ibook/{bookId}/{indexId}.html\",\r\n \"contentStart\": \"id=\\\"content\\\">\",\r\n \"contentEnd\": \"