[全量] 初始化项目代码、配置、文档及Agent协同harness

This commit is contained in:
2026-04-02 11:36:05 +08:00
parent 0553309cdf
commit 87e571d9ec
1133 changed files with 221948 additions and 0 deletions

View File

@@ -0,0 +1,313 @@
/*
Navicat Premium Data Transfer
Source Server : [生产]同城读写
Source Server Type : MySQL
Source Server Version : 50730
Source Host : huaian.rds.dinggehuo.com:33060
Source Schema : chat_gpt
Target Server Type : MySQL
Target Server Version : 50730
File Encoding : 65001
Date: 16/12/2023 13:31:09
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for gpt_agreement
-- ----------------------------
DROP TABLE IF EXISTS `gpt_agreement`;
CREATE TABLE `gpt_agreement` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`title` varchar(250) NOT NULL DEFAULT '' COMMENT '标题',
`type` smallint(6) DEFAULT '0' COMMENT '类型',
`status` smallint(6) DEFAULT '0' COMMENT '状态 0 禁用 1 启用',
`content` longtext COMMENT '内容',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='内容管理';
-- ----------------------------
-- Table structure for gpt_assistant
-- ----------------------------
DROP TABLE IF EXISTS `gpt_assistant`;
CREATE TABLE `gpt_assistant` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`title` varchar(250) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '角色名称',
`icon` varchar(250) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '角色图标',
`tag` varchar(250) NOT NULL DEFAULT '' COMMENT '标签',
`main_model` smallint(6) DEFAULT '0' COMMENT '主模型',
`description` varchar(512) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '角色描述',
`first_message` varchar(512) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT 'AI打招呼',
`system_prompt` varchar(512) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '系统提示词',
`type_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '助手分类id',
`sort` int(11) NOT NULL DEFAULT '1' COMMENT '排序',
`status` smallint(6) NOT NULL DEFAULT '1' COMMENT '状态 0 禁用 1 启用',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `type_id` (`type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3382 DEFAULT CHARSET=utf8 COMMENT='AI助理功能';
-- ----------------------------
-- Table structure for gpt_assistant_type
-- ----------------------------
DROP TABLE IF EXISTS `gpt_assistant_type`;
CREATE TABLE `gpt_assistant_type` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '分类名称',
`icon` varchar(128) NOT NULL DEFAULT '' COMMENT 'icon图标',
`sort` int(1) NOT NULL DEFAULT '0' COMMENT '排序',
`status` smallint(6) DEFAULT '1' COMMENT '状态 0 禁用 1 启用',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='助手分类';
-- ----------------------------
-- Table structure for gpt_chat
-- ----------------------------
DROP TABLE IF EXISTS `gpt_chat`;
CREATE TABLE `gpt_chat` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`chat_number` varchar(32) NOT NULL DEFAULT '' COMMENT '聊天编号',
`assistant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '角色id',
`uid` varchar(32) NOT NULL DEFAULT '' COMMENT '游客id',
`user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户id',
`title` varchar(250) DEFAULT '' COMMENT '聊天摘要',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=92 DEFAULT CHARSET=utf8 COMMENT='聊天摘要';
-- ----------------------------
-- Table structure for gpt_chat_message
-- ----------------------------
DROP TABLE IF EXISTS `gpt_chat_message`;
CREATE TABLE `gpt_chat_message` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`chat_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'chat_id',
`message_id` varchar(64) NOT NULL DEFAULT '' COMMENT '消息id',
`parent_message_id` varchar(128) NOT NULL DEFAULT '' COMMENT '回复消息id',
`model` varchar(64) NOT NULL DEFAULT '' COMMENT '模型',
`model_version` varchar(64) NOT NULL DEFAULT '' COMMENT '模型版本',
`content` longtext CHARACTER SET utf8mb4 COMMENT '消息内容',
`role` varchar(250) NOT NULL DEFAULT '' COMMENT '角色',
`finish_reason` varchar(250) DEFAULT '' COMMENT '结束原因',
`status` smallint(6) DEFAULT '1' COMMENT '状态 1 回复中 2正常 3 失败',
`app_key` varchar(128) NOT NULL DEFAULT '' COMMENT '使用的key',
`used_tokens` bigint(20) NOT NULL DEFAULT '0' COMMENT '使用token',
`response` longtext COMMENT '响应全文',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=689 DEFAULT CHARSET=utf8 COMMENT='对话消息';
-- ----------------------------
-- Table structure for gpt_comb
-- ----------------------------
DROP TABLE IF EXISTS `gpt_comb`;
CREATE TABLE `gpt_comb` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`title` varchar(250) NOT NULL DEFAULT '' COMMENT '套餐名称',
`type` smallint(6) DEFAULT '1' COMMENT '套餐类型 1 次数 2 天数',
`num` int(11) DEFAULT '0' COMMENT '包含次数',
`origin_price` decimal(10,2) DEFAULT '0.00' COMMENT '原价',
`price` decimal(10,2) DEFAULT '0.00' COMMENT '价格',
`status` smallint(6) DEFAULT '1' COMMENT '状态 0 禁用 1 启用',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员套餐';
INSERT INTO `gpt_comb` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `title`, `type`, `num`, `origin_price`, `price`, `status`, `deleted`) VALUES (1, 'System', '2023-05-04 11:37:10', 'System', '2023-12-27 03:06:08', '体验套餐', 1, 20, 2.00, 0.01, 1, 0);
INSERT INTO `gpt_comb` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `title`, `type`, `num`, `origin_price`, `price`, `status`, `deleted`) VALUES (2, 'System', '2023-05-04 11:52:08', 'System', '2023-12-27 03:06:09', '20次包', 1, 20, 10.00, 5.00, 1, 0);
INSERT INTO `gpt_comb` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `title`, `type`, `num`, `origin_price`, `price`, `status`, `deleted`) VALUES (3, 'System', '2023-05-04 11:52:36', 'System', '2023-12-27 03:06:10', '100次30天包', 1, 100, 50.00, 20.00, 1, 0);
INSERT INTO `gpt_comb` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `title`, `type`, `num`, `origin_price`, `price`, `status`, `deleted`) VALUES (4, 'System', '2023-05-04 11:53:08', 'System', '2023-12-27 03:06:12', '200次季度包', 1, 200, 100.00, 39.90, 1, 0);
INSERT INTO `gpt_comb` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `title`, `type`, `num`, `origin_price`, `price`, `status`, `deleted`) VALUES (5, 'System', '2023-05-04 11:53:36', 'System', '2023-12-27 03:06:14', '500次全年包', 1, 5000, 199.99, 99.99, 1, 0);
-- ----------------------------
-- Table structure for gpt_model
-- ----------------------------
DROP TABLE IF EXISTS `gpt_model`;
CREATE TABLE `gpt_model` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`name` varchar(32) NOT NULL DEFAULT '' COMMENT '模型名称',
`icon` varchar(255) NOT NULL DEFAULT '' COMMENT '模型logo',
`model` varchar(32) NOT NULL DEFAULT '' COMMENT '模型名称',
`version` varchar(64) NOT NULL DEFAULT '' COMMENT '模型版本',
`status` smallint(6) NOT NULL DEFAULT '1' COMMENT '状态 0 禁用 1 启用',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='大模型信息';
INSERT INTO `gpt_model` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `icon`, `model`, `version`, `status`, `deleted`) VALUES (1, 'System', '2023-12-01 01:23:51', 'System', '2023-12-01 05:39:35', 'ChatGPT', '', 'CHAT_GPT', 'gpt-3.5-turbo-0613', 1, 0);
INSERT INTO `gpt_model` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `icon`, `model`, `version`, `status`, `deleted`) VALUES (2, 'System', '2023-12-01 01:24:43', 'System', '2023-12-01 01:27:06', '文心一言', '', 'WENXIN', 'ERNIE_Bot_turbo', 1, 0);
INSERT INTO `gpt_model` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `icon`, `model`, `version`, `status`, `deleted`) VALUES (3, 'System', '2023-12-01 01:25:18', 'System', '2023-12-01 01:26:11', '通义千问', '', 'QIANWEN', 'qwen-turbo', 1, 0);
INSERT INTO `gpt_model` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `icon`, `model`, `version`, `status`, `deleted`) VALUES (4, 'System', '2023-12-01 01:25:29', 'System', '2023-12-01 01:25:58', '讯飞星火', '', 'SPARK', 'v2.1', 1, 0);
INSERT INTO `gpt_model` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `icon`, `model`, `version`, `status`, `deleted`) VALUES (5, 'System', '2023-12-27 00:38:20', 'System', '2023-12-27 00:39:28', '智谱清言', '', 'ZHIPU', 'chatGLM_6b_SSE', 1, 0);
-- ----------------------------
-- Table structure for gpt_openkey
-- ----------------------------
DROP TABLE IF EXISTS `gpt_openkey`;
CREATE TABLE `gpt_openkey` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`app_id` varchar(64) NOT NULL DEFAULT '' COMMENT 'appid',
`app_key` varchar(64) NOT NULL DEFAULT '' COMMENT 'app key',
`app_secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'app密钥',
`total_tokens` bigint(20) NOT NULL DEFAULT '0' COMMENT '总额度',
`used_tokens` bigint(20) NOT NULL DEFAULT '0' COMMENT '已用额度',
`surplus_tokens` bigint(20) NOT NULL DEFAULT '0' COMMENT '剩余token',
`status` int(1) NOT NULL DEFAULT '1' COMMENT '状态 0 禁用 1 启用',
`model` varchar(32) NOT NULL DEFAULT '' COMMENT '模型',
`remark` varchar(250) DEFAULT '' COMMENT '备注',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`),
UNIQUE KEY `app_key` (`app_key`),
KEY `model` (`model`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='openai token';
INSERT INTO `gpt_openkey` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `app_id`, `app_key`, `app_secret`, `total_tokens`, `used_tokens`, `surplus_tokens`, `status`, `model`, `remark`, `deleted`) VALUES (1, 'admin', '2023-05-04 10:10:05', 'System', '2023-10-27 01:43:51', '', '', '', 5, 1559, -1554, 0, 'CHAT_GPT', 'master@gmail.com', 0);
INSERT INTO `gpt_openkey` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `app_id`, `app_key`, `app_secret`, `total_tokens`, `used_tokens`, `surplus_tokens`, `status`, `model`, `remark`, `deleted`) VALUES (2, 'System', '2023-09-07 09:20:16', 'System', '2023-12-26 09:00:24', '', '', '', 5, 7496, -7491, 1, 'CHAT_GPT', 'master@gmail.com', 0);
INSERT INTO `gpt_openkey` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `app_id`, `app_key`, `app_secret`, `total_tokens`, `used_tokens`, `surplus_tokens`, `status`, `model`, `remark`, `deleted`) VALUES (3, 'System', '2023-09-07 09:20:48', 'System', '2023-09-12 08:07:11', '', '', '', 0, 1033, -1033, 1, 'WENXIN', '', 0);
INSERT INTO `gpt_openkey` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `app_id`, `app_key`, `app_secret`, `total_tokens`, `used_tokens`, `surplus_tokens`, `status`, `model`, `remark`, `deleted`) VALUES (4, 'System', '2023-09-12 02:24:22', 'System', '2023-10-18 09:29:08', '', '', '', 100000, 31727, 68273, 1, 'QIANWEN', '', 0);
INSERT INTO `gpt_openkey` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `app_id`, `app_key`, `app_secret`, `total_tokens`, `used_tokens`, `surplus_tokens`, `status`, `model`, `remark`, `deleted`) VALUES (5, 'System', '2023-09-12 02:25:27', 'admin', '2023-12-26 14:53:18', '', '', '', 1998204, 7479, 1990725, 1, 'SPARK', '', 0);
INSERT INTO `gpt_openkey` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `app_id`, `app_key`, `app_secret`, `total_tokens`, `used_tokens`, `surplus_tokens`, `status`, `model`, `remark`, `deleted`) VALUES (6, 'System', '2023-12-27 00:37:59', 'System', '2023-12-27 01:23:44', '', '', '', 0, 0, 0, 1, 'ZHIPU', '', 0);
-- ----------------------------
-- Table structure for gpt_order
-- ----------------------------
DROP TABLE IF EXISTS `gpt_order`;
CREATE TABLE `gpt_order` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`success_time` datetime DEFAULT NULL COMMENT '支付成功时间',
`trade_no` varchar(250) NOT NULL DEFAULT '' COMMENT '订单号',
`transaction_id` varchar(250) DEFAULT '' COMMENT '渠道交易ID',
`user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '下单用户',
`comb_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '购买套餐',
`price` decimal(10,2) DEFAULT '0.00' COMMENT '价格',
`chanel` smallint(6) DEFAULT '-1' COMMENT '支付渠道 1 微信小程序 2、微信公众号 3、微信h5 4、微信扫码',
`status` smallint(6) DEFAULT '-1' COMMENT '订单状态 1 待支付 2 支付成功 3 支付超时 4 已退款',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单';
-- ----------------------------
-- Table structure for gpt_redemption
-- ----------------------------
DROP TABLE IF EXISTS `gpt_redemption`;
CREATE TABLE `gpt_redemption` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`code` varchar(250) DEFAULT '' COMMENT '兑换码',
`num` int(11) DEFAULT '0' COMMENT '可兑次数',
`user_id` bigint(20) DEFAULT '0' COMMENT '兑换人',
`recieve_time` int(10) DEFAULT NULL COMMENT '兑换时间',
`status` int(1) DEFAULT '0' COMMENT '状态 0 未兑换 1 已兑换',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='兑换码';
-- ----------------------------
-- Table structure for gpt_upload_config
-- ----------------------------
DROP TABLE IF EXISTS `gpt_upload_config`;
CREATE TABLE `gpt_upload_config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`title` varchar(250) DEFAULT NULL COMMENT '配置名称',
`upload_replace` tinyint(4) DEFAULT '0' COMMENT '覆盖同名文件',
`thumb_status` tinyint(4) DEFAULT '0' COMMENT '缩图开关',
`thumb_width` varchar(250) DEFAULT '' COMMENT '缩放宽度',
`thumb_height` varchar(250) DEFAULT '' COMMENT '缩放高度',
`thumb_type` smallint(6) DEFAULT '0' COMMENT '缩图方式',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='缩略图配置';
-- ----------------------------
-- Table structure for gpt_upload_file
-- ----------------------------
DROP TABLE IF EXISTS `gpt_upload_file`;
CREATE TABLE `gpt_upload_file` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`filepath` varchar(255) DEFAULT '' COMMENT '图片路径',
`hash` varchar(32) DEFAULT '' COMMENT '文件hash值',
`disk` varchar(20) DEFAULT '' COMMENT '存储方式',
`type` tinyint(10) DEFAULT NULL COMMENT '文件类型',
PRIMARY KEY (`id`) USING BTREE,
KEY `hash` (`hash`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='文件管理';
-- ----------------------------
-- Table structure for gpt_user
-- ----------------------------
DROP TABLE IF EXISTS `gpt_user`;
CREATE TABLE `gpt_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` varchar(32) NOT NULL DEFAULT 'System' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`login_time` datetime DEFAULT NULL COMMENT '登录时间',
`uid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Uuid\n',
`name` varchar(250) NOT NULL DEFAULT '' COMMENT '姓名',
`nick_name` varchar(250) NOT NULL DEFAULT '' COMMENT '昵称',
`tel` varchar(250) NOT NULL DEFAULT '' COMMENT '手机号',
`password` varchar(250) NOT NULL DEFAULT '' COMMENT '密码',
`avatar` varchar(250) NOT NULL DEFAULT '' COMMENT '头像',
`openid` varchar(250) NOT NULL DEFAULT '' COMMENT 'openid',
`unionid` varchar(250) NOT NULL DEFAULT '' COMMENT 'unionid',
`ip` varchar(250) NOT NULL DEFAULT '' COMMENT '登录ip',
`num` int(11) DEFAULT '0' COMMENT '调用次数',
`share_id` bigint(20) DEFAULT '0' COMMENT '邀请人',
`type` int(1) DEFAULT '1' COMMENT '用户类型 1 微信小程序 2 公众号 3 手机号',
`status` int(1) NOT NULL DEFAULT '0' COMMENT '状态 0 禁用 1 启用\n',
`deleted` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0->未删除;1->已删除',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='会员用户';
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,8 @@
-- create table gpt_folder (
-- id bigint auto_increment comment '主键' ,
-- folder_name varchar(300) not null comment '文件夹名称',
-- primary key (id)
-- ) engine=innodb charset = utf8 comment = '文件夹信息表';
-- commit;
delete from chat_gpt.gpt_chat_message;

View File

@@ -0,0 +1,35 @@
# 修复 gpt_chat_message 表缺失字段
# 根据远程数据库结构添加缺失的字段
# 注意:如果字段已存在,执行会报错,可以忽略
# 添加 content_type 字段如果update.sql已执行过可能会报错可忽略
ALTER TABLE `gpt_chat_message`
ADD COLUMN `content_type` varchar(250) NOT NULL DEFAULT 'text' COMMENT '内容类型text文字 image : 图片' AFTER `content`;
# 添加 size 字段
ALTER TABLE `gpt_chat_message`
ADD COLUMN `size` varchar(40) DEFAULT NULL COMMENT '文件大小' AFTER `response`;
# 添加 summary 字段
ALTER TABLE `gpt_chat_message`
ADD COLUMN `summary` text COMMENT '消息总结' AFTER `size`;
# 添加 question 字段
ALTER TABLE `gpt_chat_message`
ADD COLUMN `question` text COMMENT '推荐问题' AFTER `summary`;
# 添加 think 字段(这是导致错误的字段,必须添加)
ALTER TABLE `gpt_chat_message`
ADD COLUMN `think` longtext COMMENT '思考过程' AFTER `question`;
# 添加 feedback 字段
ALTER TABLE `gpt_chat_message`
ADD COLUMN `feedback` tinyint NOT NULL DEFAULT '0' COMMENT '反馈' AFTER `question`;
# 添加 feedback_reason 字段
ALTER TABLE `gpt_chat_message`
ADD COLUMN `feedback_reason` tinyint NOT NULL DEFAULT '0' COMMENT '反馈原因' AFTER `feedback`;
# 添加 last_content 字段
ALTER TABLE `gpt_chat_message`
ADD COLUMN `last_content` longtext COMMENT '中断对话记录' AFTER `feedback_reason`;

View File

@@ -0,0 +1,45 @@
# 安全版本的修复脚本 - 使用存储过程检查字段是否存在后再添加
# 修复 gpt_chat_message 表缺失字段
DELIMITER $$
DROP PROCEDURE IF EXISTS AddColumnIfNotExists$$
CREATE PROCEDURE AddColumnIfNotExists(
IN tableName VARCHAR(128),
IN columnName VARCHAR(128),
IN columnDefinition TEXT
)
BEGIN
DECLARE columnExists INT DEFAULT 0;
SELECT COUNT(*) INTO columnExists
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = tableName
AND COLUMN_NAME = columnName;
IF columnExists = 0 THEN
SET @sql = CONCAT('ALTER TABLE `', tableName, '` ADD COLUMN `', columnName, '` ', columnDefinition);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SELECT CONCAT('Added column: ', columnName) AS result;
ELSE
SELECT CONCAT('Column already exists: ', columnName) AS result;
END IF;
END$$
DELIMITER ;
# 添加缺失的字段
CALL AddColumnIfNotExists('gpt_chat_message', 'content_type', 'varchar(250) NOT NULL DEFAULT ''text'' COMMENT ''内容类型text文字 image : 图片'' AFTER `content`');
CALL AddColumnIfNotExists('gpt_chat_message', 'size', 'varchar(40) DEFAULT NULL COMMENT ''文件大小'' AFTER `response`');
CALL AddColumnIfNotExists('gpt_chat_message', 'summary', 'text COMMENT ''消息总结'' AFTER `size`');
CALL AddColumnIfNotExists('gpt_chat_message', 'question', 'text COMMENT ''推荐问题'' AFTER `summary`');
CALL AddColumnIfNotExists('gpt_chat_message', 'think', 'longtext COMMENT ''思考过程'' AFTER `question`');
CALL AddColumnIfNotExists('gpt_chat_message', 'feedback', 'tinyint NOT NULL DEFAULT ''0'' COMMENT ''反馈'' AFTER `question`');
CALL AddColumnIfNotExists('gpt_chat_message', 'feedback_reason', 'tinyint NOT NULL DEFAULT ''0'' COMMENT ''反馈原因'' AFTER `feedback`');
CALL AddColumnIfNotExists('gpt_chat_message', 'last_content', 'longtext COMMENT ''中断对话记录'' AFTER `feedback_reason`');
# 清理存储过程
DROP PROCEDURE IF EXISTS AddColumnIfNotExists;

View File

@@ -0,0 +1,6 @@
create table gpt_folder (
id bigint auto_increment comment '主键' ,
folder_name varchar(300) not null comment '文件夹名称',
primary key (id)
) engine=innodb charset = utf8 comment = '文件夹信息表';
commit;

View File

@@ -0,0 +1,8 @@
create table chat_gpt.gpt_knowledge (
id bigint auto_increment comment '主键' ,
nick_name varchar(300) not null comment '知识库昵称',
knowledge_name varchar(300) not null comment '知识库名称',
deleted int(1) default 0 not null comment '是否删除 0->未删除;1->已删除',
primary key (id)
) engine=innodb charset = utf8 comment = '知识库信息表';
commit;

View File

@@ -0,0 +1,174 @@
DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
DROP TABLE IF EXISTS QRTZ_LOCKS;
DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
DROP TABLE IF EXISTS QRTZ_CALENDARS;
-- ----------------------------
-- 1、存储每一个已配置的 jobDetail 的详细信息
-- ----------------------------
create table QRTZ_JOB_DETAILS (
sched_name varchar(120) not null comment '调度名称',
job_name varchar(200) not null comment '任务名称',
job_group varchar(200) not null comment '任务组名',
description varchar(250) null comment '相关介绍',
job_class_name varchar(250) not null comment '执行任务类名称',
is_durable varchar(1) not null comment '是否持久化',
is_nonconcurrent varchar(1) not null comment '是否并发',
is_update_data varchar(1) not null comment '是否更新数据',
requests_recovery varchar(1) not null comment '是否接受恢复执行',
job_data blob null comment '存放持久化job对象',
primary key (sched_name, job_name, job_group)
) engine=innodb comment = '任务详细信息表';
-- ----------------------------
-- 2、 存储已配置的 Trigger 的信息
-- ----------------------------
create table QRTZ_TRIGGERS (
sched_name varchar(120) not null comment '调度名称',
trigger_name varchar(200) not null comment '触发器的名字',
trigger_group varchar(200) not null comment '触发器所属组的名字',
job_name varchar(200) not null comment 'qrtz_job_details表job_name的外键',
job_group varchar(200) not null comment 'qrtz_job_details表job_group的外键',
description varchar(250) null comment '相关介绍',
next_fire_time bigint(13) null comment '上一次触发时间(毫秒)',
prev_fire_time bigint(13) null comment '下一次触发时间(默认为-1表示不触发',
priority integer null comment '优先级',
trigger_state varchar(16) not null comment '触发器状态',
trigger_type varchar(8) not null comment '触发器的类型',
start_time bigint(13) not null comment '开始时间',
end_time bigint(13) null comment '结束时间',
calendar_name varchar(200) null comment '日程表名称',
misfire_instr smallint(2) null comment '补偿执行的策略',
job_data blob null comment '存放持久化job对象',
primary key (sched_name, trigger_name, trigger_group),
foreign key (sched_name, job_name, job_group) references QRTZ_JOB_DETAILS(sched_name, job_name, job_group)
) engine=innodb comment = '触发器详细信息表';
-- ----------------------------
-- 3、 存储简单的 Trigger包括重复次数间隔以及已触发的次数
-- ----------------------------
create table QRTZ_SIMPLE_TRIGGERS (
sched_name varchar(120) not null comment '调度名称',
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
repeat_count bigint(7) not null comment '重复的次数统计',
repeat_interval bigint(12) not null comment '重复的间隔时间',
times_triggered bigint(10) not null comment '已经触发的次数',
primary key (sched_name, trigger_name, trigger_group),
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
) engine=innodb comment = '简单触发器的信息表';
-- ----------------------------
-- 4、 存储 Cron Trigger包括 Cron 表达式和时区信息
-- ----------------------------
create table QRTZ_CRON_TRIGGERS (
sched_name varchar(120) not null comment '调度名称',
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
cron_expression varchar(200) not null comment 'cron表达式',
time_zone_id varchar(80) comment '时区',
primary key (sched_name, trigger_name, trigger_group),
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
) engine=innodb comment = 'Cron类型的触发器表';
-- ----------------------------
-- 5、 Trigger 作为 Blob 类型存储(用于 Quartz 用户用 JDBC 创建他们自己定制的 Trigger 类型JobStore 并不知道如何存储实例的时候)
-- ----------------------------
create table QRTZ_BLOB_TRIGGERS (
sched_name varchar(120) not null comment '调度名称',
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
blob_data blob null comment '存放持久化Trigger对象',
primary key (sched_name, trigger_name, trigger_group),
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
) engine=innodb comment = 'Blob类型的触发器表';
-- ----------------------------
-- 6、 以 Blob 类型存储存放日历信息, quartz可配置一个日历来指定一个时间范围
-- ----------------------------
create table QRTZ_CALENDARS (
sched_name varchar(120) not null comment '调度名称',
calendar_name varchar(200) not null comment '日历名称',
calendar blob not null comment '存放持久化calendar对象',
primary key (sched_name, calendar_name)
) engine=innodb comment = '日历信息表';
-- ----------------------------
-- 7、 存储已暂停的 Trigger 组的信息
-- ----------------------------
create table QRTZ_PAUSED_TRIGGER_GRPS (
sched_name varchar(120) not null comment '调度名称',
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
primary key (sched_name, trigger_group)
) engine=innodb comment = '暂停的触发器表';
-- ----------------------------
-- 8、 存储与已触发的 Trigger 相关的状态信息,以及相联 Job 的执行信息
-- ----------------------------
create table QRTZ_FIRED_TRIGGERS (
sched_name varchar(120) not null comment '调度名称',
entry_id varchar(95) not null comment '调度器实例id',
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
instance_name varchar(200) not null comment '调度器实例名',
fired_time bigint(13) not null comment '触发的时间',
sched_time bigint(13) not null comment '定时器制定的时间',
priority integer not null comment '优先级',
state varchar(16) not null comment '状态',
job_name varchar(200) null comment '任务名称',
job_group varchar(200) null comment '任务组名',
is_nonconcurrent varchar(1) null comment '是否并发',
requests_recovery varchar(1) null comment '是否接受恢复执行',
primary key (sched_name, entry_id)
) engine=innodb comment = '已触发的触发器表';
-- ----------------------------
-- 9、 存储少量的有关 Scheduler 的状态信息,假如是用于集群中,可以看到其他的 Scheduler 实例
-- ----------------------------
create table QRTZ_SCHEDULER_STATE (
sched_name varchar(120) not null comment '调度名称',
instance_name varchar(200) not null comment '实例名称',
last_checkin_time bigint(13) not null comment '上次检查时间',
checkin_interval bigint(13) not null comment '检查间隔时间',
primary key (sched_name, instance_name)
) engine=innodb comment = '调度器状态表';
-- ----------------------------
-- 10、 存储程序的悲观锁的信息(假如使用了悲观锁)
-- ----------------------------
create table QRTZ_LOCKS (
sched_name varchar(120) not null comment '调度名称',
lock_name varchar(40) not null comment '悲观锁名称',
primary key (sched_name, lock_name)
) engine=innodb comment = '存储的悲观锁信息表';
-- ----------------------------
-- 11、 Quartz集群实现同步机制的行锁表
-- ----------------------------
create table QRTZ_SIMPROP_TRIGGERS (
sched_name varchar(120) not null comment '调度名称',
trigger_name varchar(200) not null comment 'qrtz_triggers表trigger_name的外键',
trigger_group varchar(200) not null comment 'qrtz_triggers表trigger_group的外键',
str_prop_1 varchar(512) null comment 'String类型的trigger的第一个参数',
str_prop_2 varchar(512) null comment 'String类型的trigger的第二个参数',
str_prop_3 varchar(512) null comment 'String类型的trigger的第三个参数',
int_prop_1 int null comment 'int类型的trigger的第一个参数',
int_prop_2 int null comment 'int类型的trigger的第二个参数',
long_prop_1 bigint null comment 'long类型的trigger的第一个参数',
long_prop_2 bigint null comment 'long类型的trigger的第二个参数',
dec_prop_1 numeric(13,4) null comment 'decimal类型的trigger的第一个参数',
dec_prop_2 numeric(13,4) null comment 'decimal类型的trigger的第二个参数',
bool_prop_1 varchar(1) null comment 'Boolean类型的trigger的第一个参数',
bool_prop_2 varchar(1) null comment 'Boolean类型的trigger的第二个参数',
primary key (sched_name, trigger_name, trigger_group),
foreign key (sched_name, trigger_name, trigger_group) references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
) engine=innodb comment = '同步机制的行锁表';
commit;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
# 2024-01-09 增加内容类型字段
ALTER TABLE `chat_gpt`.`gpt_chat_message` ADD COLUMN `content_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '内容类型text文字 image : 图片' AFTER `content`;
# 2024-01-20 增加用户开启上下文字段和默认赠送次数
ALTER TABLE `chat_gpt`.`gpt_user` ADD COLUMN `context` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否开启上下文' AFTER `ip`;
ALTER TABLE `chat_gpt`.`gpt_user` MODIFY COLUMN `num` int(11) NULL DEFAULT 0 COMMENT '调用次数' AFTER `context`;
INSERT INTO `chat_gpt`.`sys_config` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `config_key`, `config_value`, `type`, `deleted`, `remark`) VALUES (8, 'admin', '2024-01-20 16:34:53', 'admin', '2024-01-20 16:34:53', '是否限制访问Chat', 'sys_chat_master', 'true', 1, 0, '是否无限访问Chat');
# 2024-01-22 增加字典 可直接体会sys_config和sys_dict和sys_dict_type表
# 更新表名gpt_base_config 为sys_base_config
INSERT INTO `chat_gpt`.`sys_dict_type` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `type`, `status`, `deleted`) VALUES (16, 'admin', '2024-01-22 09:15:45', 'admin', '2024-01-22 09:15:45', '上传类型', 'sys_oss_type', 1, 0);
INSERT INTO `chat_gpt`.`sys_dict_type` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `name`, `type`, `status`, `deleted`) VALUES (17, 'admin', '2024-01-22 09:29:29', 'System', '2024-01-22 09:29:29', '短信类型', 'sys_sms_type', 1, 0);
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (41, 'admin', '2024-01-22 09:15:57', 'admin', '2024-01-22 01:45:58', '本地上传', '1', 'sys_oss_type', '', 'primary', 0, 1, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (42, 'admin', '2024-01-22 09:16:46', 'admin', '2024-01-22 01:46:06', '阿里OSS', '2', 'sys_oss_type', '', 'success', 0, 2, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (43, 'admin', '2024-01-22 09:17:06', 'System', '2024-01-22 01:46:06', '腾讯COS', '3', 'sys_oss_type', '', 'warning', 0, 3, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (44, 'admin', '2024-01-22 09:30:24', 'System', '2024-01-22 09:30:24', '阿里云SMS', '1', 'sys_sms_type', '', 'primary', 0, 1, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (45, 'admin', '2024-01-22 09:30:37', 'System', '2024-01-22 09:30:37', '腾讯云SMS', '2', 'sys_sms_type', '', 'success', 0, 2, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (46, 'admin', '2024-01-22 15:37:59', 'System', '2024-01-22 15:37:59', '文心一言', 'WENXIN', 'gpt_model_type', '', 'success', 0, 2, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (47, 'admin', '2024-01-22 15:38:17', 'System', '2024-01-22 15:38:17', '通义千问', 'QIANWEN', 'gpt_model_type', '', 'info', 0, 3, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (48, 'admin', '2024-01-22 15:38:34', 'System', '2024-01-22 15:38:34', '讯飞星火', 'SPARK', 'gpt_model_type', '', 'warning', 0, 4, 1, 0, '');
INSERT INTO `chat_gpt`.`sys_dict` (`id`, `create_user`, `create_time`, `update_user`, `update_time`, `label`, `value`, `dict_type`, `css_class`, `list_class`, `is_default`, `sort`, `status`, `deleted`, `remark`) VALUES (49, 'admin', '2024-01-22 15:39:03', 'admin', '2024-01-22 15:39:03', '智谱清言', 'ZHIPU', 'gpt_model_type', '', 'danger', 0, 5, 1, 0, '');

View File

@@ -0,0 +1,12 @@
create table chat_gpt.writer_docs (
id bigint auto_increment comment '主键' ,
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
user_name varchar(300) not null comment '用户名',
user_id bigint default 0 not null comment '用户id',
title varchar(250) default '' null comment '文章标题',
docs longtext charset utf8mb4 null comment '文章正文',
deleted int(1) default 0 not null comment '是否删除 0->未删除;1->已删除',
primary key (id)
) engine=innodb charset = utf8 comment = '文档撰写存储表';
commit;