DROP TABLE IF EXISTS `user`|
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`password` varchar(50) NOT NULL DEFAULT '',
`nickname` varchar(50) NOT NULL DEFAULT '',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted_at` timestamp NULL DEFAULT NULL,
`avator` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
TRUNCATE TABLE `user`|
INSERT INTO `user` (`id`, `name`, `password`, `nickname`, `created_at`, `updated_at`, `deleted_at`, `avator`) VALUES
(1, 'kefu2', '202cb962ac59075b964b07152d234b70', '小白菜', '2020-06-27 19:32:41', '2020-07-04 09:32:20', NULL, '/static/images/4.jpg'),
(2, 'kefu3', '202cb962ac59075b964b07152d234b70', '中白菜', '2020-07-02 14:36:46', '2020-07-05 08:46:57', NULL, '/static/images/11.jpg')|
DROP TABLE IF EXISTS `visitor`|
CREATE TABLE `visitor` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`avator` varchar(500) NOT NULL DEFAULT '',
`source_ip` varchar(50) NOT NULL DEFAULT '',
`to_id` varchar(50) NOT NULL DEFAULT '',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted_at` timestamp NULL DEFAULT NULL,
`visitor_id` varchar(100) NOT NULL DEFAULT '',
`status` tinyint(4) NOT NULL DEFAULT '0',
`refer` varchar(500) NOT NULL DEFAULT '',
`city` varchar(100) NOT NULL DEFAULT '',
`client_ip` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `visitor_id` (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
DROP TABLE IF EXISTS `message`|
CREATE TABLE `message` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`kefu_id` varchar(100) NOT NULL DEFAULT '',
`visitor_id` varchar(100) NOT NULL DEFAULT '',
`content` varchar(2048) NOT NULL DEFAULT '',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted_at` timestamp NULL DEFAULT NULL,
`mes_type` enum('kefu','visitor') NOT NULL DEFAULT 'visitor',
`status` enum('read','unread') NOT NULL DEFAULT 'unread',
PRIMARY KEY (`id`),
KEY `kefu_id` (`kefu_id`),
KEY `visitor_id` (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
DROP TABLE IF EXISTS `user_role`|
CREATE TABLE `user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`role_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
INSERT INTO `user_role` (`id`, `user_id`, `role_id`) VALUES
(1, 1, 1),
(2, 2, 2)|
DROP TABLE IF EXISTS `role`|
CREATE TABLE `role` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
`method` varchar(100) NOT NULL DEFAULT '',
`path` varchar(2048) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
INSERT INTO `role` (`id`, `name`, `method`, `path`) VALUES
(1, '普通客服', 'GET', '/kefuinfo,/kefulist,/roles'),
(2, '管理员', '*', '*')|
DROP TABLE IF EXISTS `welcome`|
CREATE TABLE `welcome` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` varchar(100) NOT NULL DEFAULT '',
`content` varchar(500) NOT NULL DEFAULT '',
`is_default` tinyint(3) unsigned NOT NULL DEFAULT '0',
`ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
INSERT INTO `welcome` (`id`, `user_id`, `content`, `is_default`, `ctime`) VALUES
(1, 'kefu2', '本客服代码开源,欢迎star,开源地址:https://github.com/taoshihan1991/go-fly', 1, '2020-08-24 02:57:49')|
DROP TABLE IF EXISTS `ipblack`|
CREATE TABLE `ipblack` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(100) NOT NULL DEFAULT '',
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`kefu_id` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `ip` (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
DROP TABLE IF EXISTS `config`|
CREATE TABLE `config` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`conf_name` varchar(255) NOT NULL DEFAULT '',
`conf_key` varchar(255) NOT NULL DEFAULT '',
`conf_value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `conf_key` (`conf_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
INSERT INTO `config` (`id`, `conf_name`, `conf_key`, `conf_value`) VALUES (NULL, '是否开启Server酱微信提醒', 'NoticeServerJiang', 'false')|
INSERT INTO `config` (`id`, `conf_name`, `conf_key`, `conf_value`) VALUES (NULL, 'Server酱API', 'ServerJiangAPI', '')|
INSERT INTO `config` (`id`, `conf_name`, `conf_key`, `conf_value`) VALUES (NULL, '微信小程序Token', 'WeixinToken', '')|
INSERT INTO `config` (`id`, `conf_name`, `conf_key`, `conf_value`) VALUES (NULL, '首页跳转语言', 'JumpLang', 'cn')|
DROP TABLE IF EXISTS `about`|
CREATE TABLE `about` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`title_cn` varchar(255) NOT NULL DEFAULT '',
`title_en` varchar(255) NOT NULL DEFAULT '',
`keywords_cn` varchar(255) NOT NULL DEFAULT '',
`keywords_en` varchar(255) NOT NULL DEFAULT '',
`desc_cn` varchar(1024) NOT NULL DEFAULT '',
`desc_en` varchar(1024) NOT NULL DEFAULT '',
`css_js` text NOT NULL,
`html_cn` text NOT NULL,
`html_en` text NOT NULL,
`page` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `page` (`page`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8|
INSERT INTO `about` (`id`, `title_cn`, `title_en`, `keywords_cn`, `keywords_en`, `desc_cn`, `desc_en`, `css_js`, `html_cn`, `html_en`, `page`) VALUES
(NULL, 'GO-FLY - 极简强大的Go语言在线客服系统', 'GO-FLY - Simple and Powerful Go language online customer chat system', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY,一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统', 'GO-FLY,GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers', ' ', '
github.com/dgrijalva/jwt-go
\ngithub.com/gin-gonic/gin
\ngithub.com/go-sql-driver/mysql
\ngithub.com/gobuffalo/packr/v2
\ngithub.com/gorilla/websocket
\ngithub.com/ipipdotnet/ipdb-go
\ngithub.com/jinzhu/gorm
\ngithub.com/satori/go.uuid
\ngithub.com/spf13/cobra
\ngithub.com/swaggo/gin-swagger
\ngithub.com/swaggo/swag\n
\ngithub.com/dgrijalva/jwt-go
github.com/gin-gonic/gin
github.com/go-sql-driver/mysql
github.com/gobuffalo/packr/v2
github.com/gorilla/websocket
github.com/ipipdotnet/ipdb-go
github.com/jinzhu/gorm
github.com/satori/go.uuid
github.com/spf13/cobra
github.com/swaggo/gin-swagger
github.com/swaggo/swag