create table novel_tab (  
	id int not null auto_increment COMMENT '唯一id',
	book_name  varchar(1024) not null COMMENT '小说名字',
	book_id  int DEFAULT 0 COMMENT '书id',	
	appid int DEFAULT 0 COMMENT '小程序id',	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	info JSON COMMENT '详情',
	primary key (id));

create table account_tab (  
	id int not null auto_increment COMMENT '唯一id',
	account_id   int DEFAULT 0 COMMENT '账号id',	
	account_type   int DEFAULT 0 COMMENT '账号类型',	
	is_open   int DEFAULT 0 COMMENT '是否开启',	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	info JSON COMMENT '详情',
	primary key (id));
	create table classification_list_tab (  
	id int not null auto_increment COMMENT '唯一id',
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	info JSON  COMMENT  '详情',
	self_id int not NULL,
	primary key (id));

create table fan_qie_book_tab (
	id int not null auto_increment COMMENT '唯一id',
	book_name  varchar(1024) not null COMMENT '小说名字',
	book_id   varchar(1024) not null COMMENT '书id',	
	author varchar(1024) not null COMMENT '作者',
	category varchar(1024) not null COMMENT '分类',
	chapter_amount int not NULL COMMENT '章节数',
	latest_update_time varchar(1024) not null COMMENT '更新时间',
	creation_status int not null COMMENT '书本完结状态，0为已完结，1为连载中',
	genre int not null COMMENT '体裁（设置定价时，请关注该字段）- 0：长篇网文- 8：短故事- 202：付费短剧',
	length_type int not null COMMENT '短故事类型（设置定价时，请关注该字段）- 0：多章- 2：整本',
	info JSON  COMMENT  '详情',
primary key (id));


create table auto_book_link (
	id int not null auto_increment COMMENT '唯一id',
	book_name  varchar(1024) DEFAULT "" COMMENT '小说名字',
	book_id   varchar(1024) DEFAULT "" COMMENT '书id',
	type   varchar(1024) DEFAULT "" COMMENT '类型',	
	info JSON  COMMENT  '详情',
primary key (id));


create table tg_platform (
	id int not null auto_increment COMMENT '唯一id',
	tg_platform_id int,
primary key (id));


create table admin_user (  
	id int not null auto_increment COMMENT '唯一id',
	account   varchar(1024) DEFAULT "" COMMENT '账号',	
	password   varchar(1024) DEFAULT "" COMMENT '密码',	
	primary key (id));

create table tg_app (  
	id int not null auto_increment COMMENT '唯一id',
	tg_platform_id int not null  COMMENT '平台id',	
	app_id   varchar(1024) not null COMMENT '小程序ID',	
	advertiser_id   varchar(1024) not null COMMENT '所属账户ID',	
	instance_id   varchar(1024) not null COMMENT '资产ID',	
	name   varchar(1024) not null COMMENT '小程序名称',	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	primary key (id));

create table tg_main (  
	id int not null auto_increment COMMENT '唯一id',
	tg_platform_id int not null  COMMENT '平台id',	
	app_id   varchar(1024) not null COMMENT '小程序ID',	
	main_name   varchar(1024) not null COMMENT '主体名称',	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	primary key (id));

create table db_filter_config (  
	id int not null auto_increment COMMENT '唯一id',
	config_id int   COMMENT '配置id',	
	config JSON  COMMENT  '配置',
	primary key (id));

--原始数据
create table origin_data (  
	id int not null auto_increment COMMENT '唯一id',
	video_id  varchar(100)  COMMENT '视频id',	
	video_link  varchar(300)  COMMENT '视频链接',	
	title varchar(300)  COMMENT '标题',
	publish_time TIMESTAMP  COMMENT '发布时间',
	kepp_num int  COMMENT '收藏数',
	comment_num int  COMMENT '评论数',
	like_num int  COMMENT '点赞数',
	shared_num int  COMMENT '分享数',
	is_guajian int  COMMENT '是否挂件',
	guajian_link varchar(1024)  COMMENT '挂件地址',
	primary key (id));

--筛选数据
create table filter_data (  
	id int not null auto_increment COMMENT '唯一id',
	info JSON  COMMENT  '详情',
	primary key (id));
--书籍数据
create table book_data (  
	id int not null auto_increment COMMENT '唯一id',
	info JSON  COMMENT  '详情',
	primary key (id));

--收集后的数据
create table collect_data (  
	id int not null auto_increment COMMENT '唯一id',
	info JSON  COMMENT  '详情',
	primary key (id));

CREATE TABLE `filter_data` (
    `id` int NOT NULL AUTO_INCREMENT COMMENT '唯一id',
    `video_id` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '视频id',
    `video_link` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '视频链接',
    `title` varchar(300) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '标题',
    `publish_time` timestamp NULL DEFAULT NULL COMMENT '发布时间',
    `kepp_num` int DEFAULT NULL COMMENT '收藏数',
    `comment_num` int DEFAULT NULL COMMENT '评论数',
    `like_num` int DEFAULT NULL COMMENT '点赞数',
    `shared_num` int DEFAULT NULL COMMENT '分享数',
    `is_guajian` int DEFAULT NULL COMMENT '是否挂件',
	`book_id` varchar(300) DEFAULT NULL COMMENT '书id',
	`book_name` varchar(300)  DEFAULT NULL COMMENT '书名字',
	`genre`  int   DEFAULT 0 COMMENT '长中短分类',
	`words`  varchar(300)   DEFAULT '0' COMMENT '字数',
    `guajian_link` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '挂件地址',
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 6470 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci



create table get_fq_book_tab (  
	id int not null auto_increment COMMENT '唯一id',
	book_key  varchar(100)  COMMENT 'key',	
	book_id  varchar(100)  COMMENT 'book_id',	
	info JSON  COMMENT  '详情',
	primary key (id));

create table fq_book_config (  
	id int not null auto_increment COMMENT '唯一id',
	sid_tt  varchar(100)  COMMENT 'sid_tt',	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	primary key (id));

create table black_list (  
	id int not null auto_increment COMMENT '唯一id',
	product_id  varchar(64),	
	product_name  varchar(64),
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
	primary key (id));

create table pull_log (  
id int not null auto_increment COMMENT '唯一id',
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
primary key (id));

create table pull_data_config (  
id int not null auto_increment COMMENT '唯一id',
name  varchar(100)  COMMENT '名称',	
start  varchar(100)  COMMENT '开始拉取数据的事件的时间',	
interval_minute  int  COMMENT '从开始时间向前间隔多少分钟',	
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
primary key (id));



create table other_book (  
	id int not null auto_increment COMMENT '唯一id',
	product_id  varchar(64),	
	product_name  varchar(64),
	tg_platform_id int not null  COMMENT '平台id',	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
primary key (id));

create table tg_butler (  
	id int not null auto_increment COMMENT '唯一id',
	butler_name  varchar(64),	
	butler_id  int,	
	mail varchar(500),	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
primary key (id));


create table tg_mini_program_platform (  
	id int not null auto_increment COMMENT '唯一id',
	mini_program_platform_name  varchar(64),	
	mini_program_platform_id  int,	
	create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
primary key (id));
