/*
SQLyog Ultimate
MySQL - 5.7.25-28 : Database - applet
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*Table structure for table `adm_profile` */

DROP TABLE IF EXISTS `adm_profile`;

CREATE TABLE `adm_profile` (
  `adm_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `adm_name` varchar(64) NOT NULL COMMENT '姓名',
  `adm_psw` char(32) NOT NULL COMMENT '密码',
  `salt` char(6) NOT NULL DEFAULT '' COMMENT '加密盐',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0关闭,1正常',
  `is_super` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否超管',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`adm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='管理员信息';

/*Data for the table `adm_profile` */

/*Table structure for table `log_api` */

DROP TABLE IF EXISTS `log_api`;

CREATE TABLE `log_api` (
  `req_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '请求ID',
  `req_ip` varchar(15) NOT NULL DEFAULT '' COMMENT '请求用户IP',
  `req_header` varchar(2047) NOT NULL DEFAULT '',
  `req_body` varchar(2047) NOT NULL DEFAULT '',
  `resp_body` text,
  `req_time` bigint(20) DEFAULT '0' COMMENT '请求时间,ms',
  `resp_time` bigint(20) DEFAULT '0' COMMENT '响应时间,ms',
  `duration` bigint(20) DEFAULT '0' COMMENT '处理时长,ms',
  PRIMARY KEY (`req_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='api请求记录';

/*Data for the table `log_api` */

/*Table structure for table `sys_cfg` */

DROP TABLE IF EXISTS `sys_cfg`;

CREATE TABLE `sys_cfg` (
  `key` varchar(255) NOT NULL COMMENT '键',
  `value` text NOT NULL COMMENT '值',
  `memo` varchar(127) NOT NULL DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统设置';

/*Data for the table `sys_cfg` */

insert  into `sys_cfg`(`key`,`value`,`memo`) values 
('site_name','这只是个小程序','网站名称'),
('tb_access_key','123123','');

/*Table structure for table `sys_module` */

DROP TABLE IF EXISTS `sys_module`;

CREATE TABLE `sys_module` (
  `mod_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `mod_pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父级模块ID',
  `mod_name` varchar(255) NOT NULL DEFAULT '' COMMENT '模块名称',
  `position` varchar(512) NOT NULL DEFAULT '' COMMENT '位置',
  `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题',
  `subtitle` varchar(255) NOT NULL DEFAULT '' COMMENT '副标题',
  `icon` varchar(512) NOT NULL DEFAULT '' COMMENT '图标',
  `img` varchar(512) NOT NULL DEFAULT '' COMMENT '图片',
  `font-color` varchar(128) NOT NULL DEFAULT '' COMMENT '文字颜色',
  `bg_img` varchar(512) NOT NULL DEFAULT '' COMMENT '背景图片',
  `bg_color` varchar(512) NOT NULL DEFAULT '' COMMENT '背景颜色',
  `badge` varchar(512) NOT NULL DEFAULT '' COMMENT 'badge图片',
  `path` varchar(255) NOT NULL DEFAULT '' COMMENT '跳转路径',
  `data` text COMMENT '内容',
  `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
  `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '0不显示,1显示',
  `is_global` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否全局显示',
  `device` varchar(255) NOT NULL DEFAULT 'wx_applet' COMMENT '使用设备,wx_applet,toutiao_applet,baidu_,toutiao_applet,tiktok_,toutiao_applet,baidu_applet,wap,android,ios',
  `create_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`mod_id`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COMMENT='系统模块';

/*Data for the table `sys_module` */

insert  into `sys_module`(`mod_id`,`mod_pid`,`mod_name`,`position`,`title`,`subtitle`,`icon`,`img`,`font-color`,`bg_img`,`bg_color`,`badge`,`path`,`data`,`sort`,`state`,`is_global`,`device`,`create_at`,`update_at`) values 
(1,0,'index','','首页','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:18:44'),
(2,0,'nav','','底部导航','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:18:42'),
(3,0,'genre','','分类','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:16:34'),
(4,0,'person','','个人中心','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:17:44'),
(5,2,'nav_home','nav','首页','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:21:07'),
(6,2,'nav_channel','nav','分类','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:25:06'),
(7,2,'nav_person','nav','个人','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:28:36'),
(8,0,'index_title','index','嗨如意','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:29:04'),
(9,0,'index_search','index','','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:31:13'),
(10,0,'index_search_placeholder','search','','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:32:07'),
(11,0,'index_search_icon','search','','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:32:07'),
(12,0,'index_search_button','search','搜索','','','','','','','','',NULL,0,1,0,'wx_applet',0,'2020-08-15 16:32:16');

/*Table structure for table `user_profile` */

DROP TABLE IF EXISTS `user_profile`;

CREATE TABLE `user_profile` (
  `uid` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` varchar(32) NOT NULL COMMENT '用户名',
  `password` char(32) NOT NULL COMMENT '密码',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  `phone` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号码',
  `level` tinyint(1) NOT NULL,
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

/*Data for the table `user_profile` */

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
