/*
 Navicat Premium Dump SQL

 Source Server         : 测试库
 Source Server Type    : MySQL
 Source Server Version : 80404 (8.4.4)
 Source Host           : 101.43.12.11:3306
 Source Schema         : nl_admin

 Target Server Type    : MySQL
 Target Server Version : 80404 (8.4.4)
 File Encoding         : 65001

 Date: 14/05/2025 15:53:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for nl_admin
-- ----------------------------
DROP TABLE IF EXISTS `nl_admin`;
CREATE TABLE `nl_admin`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `open_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'OpenID，后期整合萧康服务中心会用到',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
  `nick_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '昵称',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
  `phone` char(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户手机',
  `email` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户邮箱',
  `code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '业务员推广码',
  `role_id` int NOT NULL DEFAULT 0 COMMENT '角色',
  `province_id` int NOT NULL DEFAULT 0 COMMENT '省',
  `city_id` int NOT NULL DEFAULT 0 COMMENT '市',
  `reg_ip` bigint NOT NULL DEFAULT 0 COMMENT '注册IP',
  `last_login_time` int NOT NULL DEFAULT 0 COMMENT '最后登录时间',
  `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '最后登录IP',
  `ip_table` json NOT NULL COMMENT '常用登录IP地址列表',
  `operation_password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '操作密码',
  `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '用户状态 0正常 1禁用',
  `created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
  `deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '管理员表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of nl_admin
-- ----------------------------
INSERT INTO `nl_admin` VALUES (1, 'nl_28686ad68682180e26836c721a52', '', '超管', '$2y$12$FXKlnItms3NoCLsJKQyVa.03kuRq8ltzdmc.ksf7rLKKPfGznpjnu', '15100000000', 'workerqi@163.com', '517117', 1, 0, 0, 0, 0, '127.0.0.1', '[\"127.0.0.1\"]', '0', '', 1, 0, 1747026536, 0);

-- ----------------------------
-- Table structure for nl_admin_notice
-- ----------------------------
DROP TABLE IF EXISTS `nl_admin_notice`;
CREATE TABLE `nl_admin_notice`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '消息标题',
  `detail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '简介',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '消息内容',
  `type` int NOT NULL DEFAULT 0 COMMENT '消息类型',
  `user_id` int NOT NULL DEFAULT 0 COMMENT '关联用户ID',
  `status` int NOT NULL DEFAULT 0 COMMENT '状态 0：未读 1：已读',
  `created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
  `deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '管理员消息列表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of nl_admin_notice
-- ----------------------------

-- ----------------------------
-- Table structure for nl_api_op_log
-- ----------------------------
DROP TABLE IF EXISTS `nl_api_op_log`;
CREATE TABLE `nl_api_op_log`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` int NOT NULL COMMENT '操作用户ID',
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作路由',
  `method` tinyint(1) NOT NULL DEFAULT 0 COMMENT '请求方式 0：未知 1：GET 2：POST',
  `controller` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作的控制器',
  `ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作者IP地址',
  `param` json NOT NULL COMMENT '请求携带参数',
  `result` json NOT NULL COMMENT '返回json',
  `type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '操作状态 0：成功 1：失败',
  `result_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '返回状态码',
  `platform_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '平台类型 0：总后台 1：门店后台 2：小程序',
  `belong_id` int NOT NULL DEFAULT 0 COMMENT '所属平台ID',
  `user_type` int NOT NULL DEFAULT 0 COMMENT '用户类型',
  `equipment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '操作系统',
  `browser` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '浏览器',
  `created_at` int NOT NULL DEFAULT 0 COMMENT '操作时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16860 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '新的后台API访问日志记录' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of nl_api_op_log
-- ----------------------------

-- ----------------------------
-- Table structure for nl_code_generation
-- ----------------------------
DROP TABLE IF EXISTS `nl_code_generation`;
CREATE TABLE `nl_code_generation`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单标题',
  `file_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '文件名称',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '下载链接',
  `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '生成参数',
  `created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
  `deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '代码生成记录' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of nl_code_generation
-- ----------------------------

-- ----------------------------
-- Table structure for nl_file
-- ----------------------------
DROP TABLE IF EXISTS `nl_file`;
CREATE TABLE `nl_file`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` int NOT NULL DEFAULT 0 COMMENT '用户ID',
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '文件地址',
  `type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '文件类型 0：图片 1：视频 2：音频 3：excel 4：压缩包 ',
  `source` tinyint(1) NOT NULL DEFAULT 0 COMMENT '来源 0：后台 1：用户端',
  `created_at` int NOT NULL COMMENT '上传时间',
  `updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
  `deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '文件表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of nl_file
-- ----------------------------

-- ----------------------------
-- Table structure for nl_menu
-- ----------------------------
DROP TABLE IF EXISTS `nl_menu`;
CREATE TABLE `nl_menu`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单标题',
  `icon` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单图标',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '页面Name，全局唯一',
  `path` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '访问路由',
  `component` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '组件路径需要去掉 views/ 和 .vue',
  `redirect` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '父级菜单重定向的子集菜单',
  `keep_alive` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否开启页面缓存 0：开启 1：关闭',
  `hide_in_menu` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否将页面展示在菜单栏 0：展示 1：隐藏',
  `affix_tab` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否为置顶页 0：是 1：否',
  `badge` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '菜单的徽标',
  `badge_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '用于配置页面的徽标类型，0：dot 小红点 1：normal 文本',
  `badge_variants` tinyint(1) NOT NULL DEFAULT 0 COMMENT '用于配置页面的徽标颜色 \r\n0：default 1：destructive 2：primary 3：success 4： warning',
  `iframe_src` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '内嵌的页面路径',
  `pid` int NOT NULL DEFAULT 0 COMMENT '父级菜单id',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `query` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '默认查询参数',
  `created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
  `deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of nl_menu
-- ----------------------------
INSERT INTO `nl_menu` VALUES (1, '概览', 'twemoji:house-with-garden', 'Dashboard', '/', 'BasicLayout', '', 0, 0, 1, '', 0, 0, '', 0, -1, '', 1734485082, 1734486088, 0);
INSERT INTO `nl_menu` VALUES (2, '分析页', 'lucide:area-chart', 'Analytics', '/analytics', '/dashboard/analytics/index', '', 1, 0, 0, '', 0, 0, '', 1, 0, '', 1734485206, 1734485814, 0);
INSERT INTO `nl_menu` VALUES (3, '工作台', 'carbon:workspace', 'Workspace', '/workspace', '/dashboard/workspace/index', '', 1, 0, 1, '', 0, 0, '', 1, 0, '', 1734486030, 0, 0);
INSERT INTO `nl_menu` VALUES (4, '关于', 'lucide:copyright', 'About', '/about', '/_core/about/index.vue', '', 1, 0, 1, '', 0, 0, '', 0, 999999999, '', 0, 0, 0);
INSERT INTO `nl_menu` VALUES (5, '基础管理', 'logos:openjs-foundation-icon', 'System', '/system', 'BasicLayout', '', 0, 0, 1, '', 0, 0, '', 0, 1000, '', 1734486082, 1735117933, 0);
INSERT INTO `nl_menu` VALUES (6, '管理员管理', 'grommet-icons:user-admin', 'SystemUser', '/system/user', '/system/admin/index', '', 1, 0, 1, '', 0, 0, '', 5, 0, '', 1734486178, 0, 0);
INSERT INTO `nl_menu` VALUES (7, '角色管理', 'carbon:user-role', 'SystemRole', '/system/role', '/system/role/index', '', 1, 0, 1, '', 0, 0, '', 5, 1, '', 1734486291, 1734489429, 0);
INSERT INTO `nl_menu` VALUES (8, '菜单管理', 'line-md:menu', 'SystemMenu', '/system/menu', '/system/menu/index', '', 1, 0, 1, '', 0, 0, '', 5, 2, '', 1734486345, 0, 0);
INSERT INTO `nl_menu` VALUES (9, '代码生成', 'fluent-color:code-20', 'CodeGeneration', '/code-generation', '/code-generation/index', '', 1, 0, 1, '', 0, 0, '', 0, 99999999, '', 0, 0, 0);

-- ----------------------------
-- Table structure for nl_role
-- ----------------------------
DROP TABLE IF EXISTS `nl_role`;
CREATE TABLE `nl_role`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色名称',
  `value` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色值',
  `pid` int NOT NULL DEFAULT 0 COMMENT '上级角色',
  `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '角色说明',
  `created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int NOT NULL DEFAULT 0 COMMENT '更新时间',
  `deleted_at` int NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of nl_role
-- ----------------------------
INSERT INTO `nl_role` VALUES (1, '超级管理员', 'admin', 0, '', 0, 0, 0);

-- ----------------------------
-- Table structure for nl_role_menu_relations
-- ----------------------------
DROP TABLE IF EXISTS `nl_role_menu_relations`;
CREATE TABLE `nl_role_menu_relations`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_id` int NOT NULL DEFAULT 0 COMMENT '角色ID',
  `menu_id` int NOT NULL DEFAULT 0 COMMENT '菜单ID',
  `created_at` int NOT NULL DEFAULT 0 COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色权限绑定表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of nl_role_menu_relations
-- ----------------------------
INSERT INTO `nl_role_menu_relations` VALUES (1, 1, 1, 1747033198);
INSERT INTO `nl_role_menu_relations` VALUES (2, 1, 2, 1747033198);
INSERT INTO `nl_role_menu_relations` VALUES (3, 1, 3, 1747033198);
INSERT INTO `nl_role_menu_relations` VALUES (4, 1, 4, 1747033198);
INSERT INTO `nl_role_menu_relations` VALUES (5, 1, 5, 1747033198);
INSERT INTO `nl_role_menu_relations` VALUES (6, 1, 6, 1747033198);
INSERT INTO `nl_role_menu_relations` VALUES (7, 1, 7, 1747033198);
INSERT INTO `nl_role_menu_relations` VALUES (8, 1, 8, 1747033198);

SET FOREIGN_KEY_CHECKS = 1;
