/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80032
 Source Host           : localhost:3306
 Source Schema         : tansci_boot

 Target Server Type    : MySQL
 Target Server Version : 80032
 File Encoding         : 65001

 Date: 11/01/2024 10:29:46
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for lc_pages
-- ----------------------------
DROP TABLE IF EXISTS `lc_pages`;
CREATE TABLE `lc_pages`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '页面标题',
  `subtitle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '副标题',
  `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '父页面',
  `pageschema` json NULL COMMENT '页面json',
  `status` int NULL DEFAULT NULL COMMENT '状态：0、正常，1、禁用',
  `creator_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '页面开发' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of lc_pages
-- ----------------------------
INSERT INTO `lc_pages` VALUES ('306eeeb4daa0674cbf4026f6910ba5a0', '表格例子', '支持增删改查', '0', '{\"id\": \"u:e6cbae2af395\", \"body\": [{\"id\": \"pages_crud\", \"api\": {\"url\": \"/tansci/lowcode/lcPages/page\", \"data\": {\"size\": \"${perPage}\", \"title\": \"${title}\", \"current\": \"${page}\"}, \"method\": \"get\", \"messages\": {}, \"responseData\": {\"data\": \"${result.records}\"}}, \"name\": \"pages_crud\", \"type\": \"crud\", \"filter\": {\"id\": \"u:5ad1c4a6d950\", \"body\": [{\"id\": \"u:f75f39cb2469\", \"name\": \"title\", \"type\": \"input-text\", \"placeholder\": \"请输入名称\"}, {\"id\": \"u:c5f5700a399d\", \"name\": \"city\", \"type\": \"input-city\", \"label\": \"城市选择\", \"allowCity\": true, \"extractValue\": true, \"allowDistrict\": true}], \"title\": \"条件搜索\", \"actions\": [{\"id\": \"u:351ace1a07f0\", \"icon\": \"fa fa-plus\", \"size\": \"sm\", \"type\": \"button\", \"label\": \"添加\", \"dialog\": {\"body\": {\"api\": \"/tansci/lcPages/save\", \"body\": [{\"name\": \"title\", \"type\": \"input-text\", \"label\": \"名称\", \"required\": true}, {\"name\": \"remarks\", \"type\": \"input-text\", \"label\": \"描述\", \"required\": true}], \"name\": \"sample-edit-form\", \"type\": \"form\"}, \"title\": \"添加\"}, \"target\": \"pages_crud\", \"actionType\": \"dialog\"}, {\"id\": \"u:6309a99bd03a\", \"size\": \"sm\", \"type\": \"reset\", \"label\": \"重置\"}, {\"id\": \"u:e541fe6332bc\", \"size\": \"sm\", \"type\": \"submit\", \"label\": \"查询\", \"level\": \"primary\"}], \"submitText\": \"\"}, \"columns\": [{\"id\": \"u:6ce5ff1520ad\", \"name\": \"id\", \"type\": \"text\", \"label\": \"ID\"}, {\"id\": \"u:0044e13a9da6\", \"name\": \"title\", \"type\": \"text\", \"label\": \"页面标题\"}, {\"id\": \"u:e03d48488d41\", \"name\": \"subtitle\", \"type\": \"text\", \"label\": \"副标题\"}, {\"id\": \"u:d1fe9b9479cf\", \"name\": \"status\", \"type\": \"status\", \"label\": \"状态\", \"source\": {\"0\": {\"icon\": \"fa fa-check-circle\", \"color\": \"#67C23A\", \"label\": \"已发布\"}, \"1\": {\"icon\": \"fa fa-times-circle\", \"color\": \"#F56C6C\", \"label\": \"未发布\"}}}, {\"id\": \"u:91aadb1310ce\", \"name\": \"remarks\", \"type\": \"text\", \"label\": \"描述\"}, {\"id\": \"u:91aadb1310ce\", \"name\": \"updateTime\", \"type\": \"text\", \"label\": \"更新时间\"}, {\"id\": \"u:91aadb1310ce\", \"name\": \"createTime\", \"type\": \"text\", \"label\": \"创建时间\"}, {\"id\": \"u:b53dd325281b\", \"type\": \"operation\", \"label\": \"操作\", \"width\": 130, \"buttons\": [{\"id\": \"u:19ee43a7c211\", \"type\": \"button\", \"label\": \"详情\", \"level\": \"link\", \"dialog\": {\"body\": {\"body\": [{\"name\": \"title\", \"type\": \"static\", \"label\": \"名称\"}, {\"type\": \"divider\"}, {\"name\": \"remarks\", \"type\": \"static\", \"label\": \"描述\"}, {\"type\": \"divider\"}, {\"name\": \"status\", \"type\": \"static\", \"label\": \"状态\"}, {\"type\": \"divider\"}, {\"name\": \"updateTime\", \"type\": \"static\", \"label\": \"更新时间\"}, {\"type\": \"divider\"}, {\"name\": \"pageschema\", \"type\": \"json\", \"label\": \"内容\"}], \"type\": \"form\"}, \"size\": \"lg\", \"title\": \"查看\"}, \"actionType\": \"dialog\"}, {\"id\": \"u:4cde2885b9f0\", \"type\": \"button\", \"label\": \"编辑\", \"level\": \"link\", \"dialog\": {\"body\": {\"api\": \"/tansci/lcPages/update\", \"body\": [{\"name\": \"title\", \"type\": \"input-text\", \"label\": \"名称\", \"required\": true}, {\"name\": \"remarks\", \"type\": \"input-text\", \"label\": \"描述\", \"required\": true}], \"name\": \"sample-edit-form\", \"type\": \"form\"}, \"title\": \"编辑\"}, \"actionType\": \"dialog\"}, {\"id\": \"u:dd3568d00c3a\", \"api\": \"get:/tansci/lcPages/delete/${id}\", \"type\": \"button\", \"label\": \"删除\", \"level\": \"link\", \"className\": \"text-danger\", \"actionType\": \"ajax\", \"confirmText\": \"您确认要删除?\"}], \"toggled\": true}], \"messages\": {}, \"draggable\": false, \"bulkActions\": [], \"perPageAvailable\": [10]}], \"type\": \"page\", \"title\": \"\", \"toolbar\": []}', 0, '534a37c366ec47878a6b0c85703d0bc2', '2024-01-11 10:27:32', '2023-05-11 11:24:39', '支持增删改查、分页、筛选的表格例子');
INSERT INTO `lc_pages` VALUES ('7f08e688-de5a-11ed-8f49-00163e228eed', '轮播图', '轮播图', '0', '{\"id\": \"u:a457fe5d710c\", \"body\": [{\"id\": \"u:b008adde5469\", \"body\": [{\"id\": \"u:ee0376499f18\", \"type\": \"carousel\", \"height\": \"300\", \"options\": [{\"image\": \"https://aisuda.bce.baidu.com/amis/static/photo/3893101144_bff2dc9.jpg\"}, {\"image\": \"https://aisuda.bce.baidu.com/amis/static/photo/bd3eb13533fa828b13b24500f31f4134960a5a44_81bbc2d.jpg\"}, {\"image\": \"https://aisuda.bce.baidu.com/amis/static/photo/da6376bf988c_3360340.jpg\"}], \"controlsTheme\": \"light\"}], \"type\": \"panel\", \"title\": \"直接页面配置\"}], \"type\": \"page\", \"style\": {\"boxShadow\": \" 0px 0px 0px 0px transparent\"}, \"pullRefresh\": {\"disabled\": true}, \"asideResizor\": false}', 0, NULL, '2024-01-11 09:51:22', '2023-05-11 10:58:43', '轮播图测试');
INSERT INTO `lc_pages` VALUES ('ce620f517565f989d718385d4e4033ac', 'aaaa', NULL, NULL, NULL, NULL, '534a37c366ec47878a6b0c85703d0bc2', '2023-05-12 08:55:56', '2023-05-12 08:55:56', 'aaaa');

-- ----------------------------
-- Table structure for lc_pages_menu
-- ----------------------------
DROP TABLE IF EXISTS `lc_pages_menu`;
CREATE TABLE `lc_pages_menu`  (
  `pages_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '页面id',
  `menu_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单id',
  PRIMARY KEY (`pages_id`, `menu_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '页面菜单关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of lc_pages_menu
-- ----------------------------
INSERT INTO `lc_pages_menu` VALUES ('306eeeb4daa0674cbf4026f6910ba5a0', 'd2df5734-1ca6-11ee-8b16-e0be038740d4');
INSERT INTO `lc_pages_menu` VALUES ('7f08e688-de5a-11ed-8f49-00163e228eed', 'eb404f1c-1ca6-11ee-8b16-e0be038740d4');

-- ----------------------------
-- Table structure for magic_api_backup
-- ----------------------------
DROP TABLE IF EXISTS `magic_api_backup`;
CREATE TABLE `magic_api_backup`  (
  `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '原对象ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '原名称',
  `content` blob NULL COMMENT '备份内容',
  `tag` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '标签',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类型',
  `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作人',
  `create_date` datetime NULL DEFAULT NULL COMMENT '备份时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'magic api 备份' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of magic_api_backup
-- ----------------------------

-- ----------------------------
-- Table structure for magic_api_file
-- ----------------------------
DROP TABLE IF EXISTS `magic_api_file`;
CREATE TABLE `magic_api_file`  (
  `file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '路径',
  `file_content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容',
  PRIMARY KEY (`file_path`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'magic api 接口表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of magic_api_file
-- ----------------------------
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"fc09d5b985f44120956d5d4f9fbd3658\",\r\n  \"name\" : \"应用管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"0\",\r\n  \"path\" : \"lowcode\",\r\n  \"createTime\" : 1688627828353,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"页面管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"fc09d5b985f44120956d5d4f9fbd3658\",\r\n  \"path\" : \"lcPages\",\r\n  \"createTime\" : 1688627828384,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/保存.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"a3ec119d481146d8940e01a203a733a1\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"保存\",\r\n  \"createTime\" : 1688627828389,\r\n  \"updateTime\" : 1688517368338,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"save\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.insert(\"\"\"\r\n    INSERT INTO lc_pages(`id`, `title`, `subtitle`, `parent_id`, `pageschema`, `status`, `creator_id`, `update_time`, `create_time`, `remarks`) \r\n    VALUES \r\n    (uuid(), #{body.title},#{body.subtitle},#{body.parentId},#{body.pageschema},0,#{body.creatorId},now(),now(),#{body.remarks})\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/修改.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"b63cac7294f94a74bdf5794f88679780\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : 1688627828392,\r\n  \"updateTime\" : 1688517381359,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"update\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.update(\"\"\"\r\n    update lc_pages set \r\n    update_time = now()\r\n    ?{body.title, ,`title` = #{body.title}}\r\n    ?{body.subtitle, ,`subtitle` = #{body.subtitle}}\r\n    ?{body.pageschema, ,`pageschema` = #{body.pageschema}}\r\n    ?{body.status, ,`status` = #{body.status}}\r\n    ?{body.parentId, ,`parent_id` = #{body.parentId}}\r\n    ?{body.creatorId, ,`creator_id` = #{body.creatorId}}\r\n    ?{body.remarks, ,`remarks` = #{body.remarks}}\r\n    where id = #{body.id}\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/分页.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"0b62bb303bc9442f8b0a9b0757d62c8c\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"分页\",\r\n  \"createTime\" : 1688627828395,\r\n  \"updateTime\" : 1688517369926,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"page\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar list = db.page(\"\"\"\r\n    select p.*,GROUP_CONCAT(menu_id) as menu_ids\r\n    from lc_pages p\r\n    left join lc_pages_menu m on m.pages_id = p.id\r\n    where 1 = 1\r\n    ?{status != null, and status = #{status}}\r\n    ?{parentId, and parent_id = #{parentId}}\r\n    ?{creatorId, and creator_id = #{creatorId}}\r\n    ?{title, and title = #{title}}\r\n    GROUP BY p.id\r\n    order by update_time desc\r\n\"\"\")\r\nreturn list');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/删除.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"2bfd044cf07f42b4a9c1ce7402b8de4e\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : 1688627828397,\r\n  \"updateTime\" : 1688517379847,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"delete/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    db.table(\"lc_pages\").where().eq(\"id\", id).delete()\r\n    db.table(\"lc_pages_menu\").where().eq(\"pages_id\", id).delete()\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/批量删除.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"33fbeebccb774feaba2e5276843658e5\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"批量删除\",\r\n  \"createTime\" : 1688627828399,\r\n  \"updateTime\" : 1688517378271,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"batchDelete\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    for(item in body.ids){\r\n        db.table(\"lc_pages\").where().eq(\"id\", item).delete()\r\n        db.table(\"lc_pages_menu\").where().eq(\"pages_id\", item).delete()\r\n    }\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/根据ID获取页面信息.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"c39d0fa055c848a4b073f604e9cac7b7\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"根据ID获取页面信息\",\r\n  \"createTime\" : 1688627828402,\r\n  \"updateTime\" : 1688517376767,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"get/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.table(\"lc_pages\").where().eq(\"id\",id).selectOne()');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/根据菜单ID获取页面信息.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"ab48add7e308465fb5a77d7cb4c52218\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"根据菜单ID获取页面信息\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688697302675,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"pagesInfo/{menuId}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar info = db.selectOne(\"\"\"select * from lc_pages_menu where menu_id = #{menuId}\"\"\")\r\nif(info == null){\r\n     exit 500, \'该菜单未绑定页面!\'\r\n}\r\n\r\nreturn db.table(\"lc_pages\").where().eq(\"id\",info.pagesId).selectOne()');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/绑定菜单.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"6e26766b5468454ea95c2d856d8fb45f\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"name\" : \"绑定菜单\",\r\n  \"createTime\" : 1688627828409,\r\n  \"updateTime\" : 1688517366542,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"bindMenu\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    db.table(\"lc_pages_menu\").where().eq(\"pages_id\", body.id).delete()\r\n    if(body.menuIds){\r\n        for(item in body.menuIds){\r\n            db.table(\"lc_pages_menu\").where().eq(\"menu_id\", item).delete()\r\n            db.insert(\"\"\"insert into lc_pages_menu(pages_id,menu_id)values(#{body.id},#{item})\"\"\")\r\n        }\r\n    }\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统监控/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统监控/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"da560e6b25b844519c3ac1c34112e298\",\r\n  \"name\" : \"系统监控\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"0\",\r\n  \"path\" : \"monitor\",\r\n  \"createTime\" : 1688700280021,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统监控/在线用户.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"b2cd6dc8ddc84ec6bb3b66b9ee4ebee3\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"da560e6b25b844519c3ac1c34112e298\",\r\n  \"name\" : \"在线用户\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688701258996,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"onlineUser\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\n\r\nvar tokens = StpUtil.searchTokenValue(\"\", -1, 9999)\r\nreturn db.page(\"\"\"\r\n    select * from sys_login_log\r\n    where token in (#{tokens})\r\n    ?{username, and username like concat(\'%\', #{username}, \'%\')}\r\n    ?{ip, and ip like concat(\'%\', #{ip}, \'%\')}\r\n    order by create_time desc\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统监控/操作日志.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"a890089249404ace83909a07caf072b4\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"da560e6b25b844519c3ac1c34112e298\",\r\n  \"name\" : \"操作日志\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688701069367,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"operLog\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.page(\"\"\"\r\n    select * from sys_oper_log\r\n    where 1 = 1\r\n    ?{username, and user_name like concat(\'%\', #{username}, \'%\')}\r\n    ?{ip, and ip like concat(\'%\', #{ip}, \'%\')}\r\n    order by create_time desc\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统监控/登录日志.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"bc0e3bef99ef41698c8a6157898d0869\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"da560e6b25b844519c3ac1c34112e298\",\r\n  \"name\" : \"登录日志\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688700847430,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"loginLog\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.page(\"\"\"\r\n    select * from sys_login_log\r\n    where 1 = 1\r\n    ?{username, and username like concat(\'%\', #{username}, \'%\')}\r\n    ?{ip, and ip like concat(\'%\', #{ip}, \'%\')}\r\n    order by create_time desc\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统监控/踢人.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"d52169146d8941139854d462852e4e2e\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"da560e6b25b844519c3ac1c34112e298\",\r\n  \"name\" : \"踢人\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688701260804,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"kick/{kick}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\n\r\nreturn StpUtil.logoutByTokenValue(token);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"name\" : \"系统管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"0\",\r\n  \"path\" : \"/system\",\r\n  \"createTime\" : 1688627065391,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/字典管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/字典管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"79b4851948504948ad76ca5310c94bfd\",\r\n  \"name\" : \"字典管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"path\" : \"dict\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688694277933,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/字典管理/保存.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"fd2d0d2447754c18ba57c68e8402647c\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"79b4851948504948ad76ca5310c94bfd\",\r\n  \"name\" : \"保存\",\r\n  \"createTime\" : 1688627065458,\r\n  \"updateTime\" : 1688517335971,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"save\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.insert(\"\"\"\r\n    INSERT INTO sys_dict(`id`, `parent_id`, `group_name`, `type`, `dic_value`, `dic_label`, `sort`, `text1`, `text2`, `text3`, `update_time`, `create_time`, `remarks`) \r\n    VALUES \r\n    (uuid(), #{body.parentId},#{body.groupName},#{body.type},#{body.dicValue},#{body.dicLabel},#{body.sort},#{body.text1},#{body.text2},#{body.text3},now(),now(),#{body.remarks})\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/字典管理/修改.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"35c262b4bd4e4cd29c3f852e5d487cbd\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"79b4851948504948ad76ca5310c94bfd\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : 1688627065461,\r\n  \"updateTime\" : 1688517341169,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"update\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.update(\"\"\"\r\n    update sys_dict set \r\n    update_time = now()\r\n    ?{body.parentId, ,`parent_id` = #{body.parentId}}\r\n    ?{body.groupNme, ,`group_name` = #{body.groupName}}\r\n    ?{body.type, ,`type` = #{body.type}}\r\n    ?{body.dicValue, ,`dic_value` = #{body.dicValue}}\r\n    ?{body.dicLabel, ,`dic_label` = #{body.dicLabel}}\r\n    ?{body.sort, ,`sort` = #{body.sort}}\r\n    ?{body.text1, ,`text1` = #{body.text1}}\r\n    ?{body.text2, ,`text2` = #{body.text2}}\r\n    ?{body.text3, ,`text3` = #{body.text3}}\r\n    ?{body.remarks, ,`remarks` = #{body.remarks}}\r\n    where id = #{body.id}\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/字典管理/列表.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"42c28b72bc3e4560b407282a40737ba9\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"79b4851948504948ad76ca5310c94bfd\",\r\n  \"name\" : \"列表\",\r\n  \"createTime\" : 1688627065464,\r\n  \"updateTime\" : 1688517337704,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"list\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.select(\"\"\"\r\n    select d.* \r\n    from sys_dict d\r\n    where 1 = 1\r\n    ?{parentId, and parent_id = #{parentId}}\r\n    ?{groupName, and group_name = #{groupName}}\r\n    ?{dicValue, and dic_value = #{dicValue}}\r\n    order by sort\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/字典管理/删除.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"4c658ae507574ce9a0503ac8fea346ae\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"79b4851948504948ad76ca5310c94bfd\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : 1688627065467,\r\n  \"updateTime\" : 1688517339291,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"delete/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    var list = db.select(\"\"\"\r\n        with recursive t as (	\r\n            select id from sys_dict where id = #{id}\r\n            union all\r\n            select a.id from sys_dict a \r\n            join t on a.parent_id = t.id\r\n        )\r\n        select id from t\r\n    \"\"\")\r\n\r\n    for(item in list){\r\n        db.table(\"sys_dict\").where().eq(\"id\", item.id).delete()\r\n    }\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/字典管理/字典树.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"45ee381e52c64cc9ad8263b1dfbe6709\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"79b4851948504948ad76ca5310c94bfd\",\r\n  \"name\" : \"字典树\",\r\n  \"createTime\" : 1688627065470,\r\n  \"updateTime\" : 1688517343301,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"tree\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar list = db.select(\"\"\"\r\n    select d.* \r\n    from sys_dict d\r\n    where 1 = 1\r\n    ?{parentId, and parent_id = #{parentId}}\r\n    ?{groupName, and group_name = #{groupName}}\r\n    ?{dicValue, and dic_value = #{dicValue}}\r\n    order by sort\r\n\"\"\")\r\n\r\nif (list.length == 1) {\r\n    return list;\r\n}\r\nlist.filter(item => {\r\n    var arr = list.filter(child => item.id == child.parentId);\r\n    arr.length > 0 ? (item.children = arr) : false;\r\n    return item.parentId == 0;\r\n})\r\n\r\nreturn list.filter(item => item.parentId == 0);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/安全/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/安全/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"1e5946084f1b47b5aea7fb8b2829c2cd\",\r\n  \"name\" : \"安全\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"path\" : \"auth\",\r\n  \"createTime\" : 1688628736494,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/安全/登出.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"80444160d7dd4f59991a792b1dafd4ab\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"1e5946084f1b47b5aea7fb8b2829c2cd\",\r\n  \"name\" : \"登出\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688634354515,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"logout\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\nStpUtil.logout();\r\nexit 200');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/安全/登录.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"60a768ae9748403dbcdf07e598511aa8\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"1e5946084f1b47b5aea7fb8b2829c2cd\",\r\n  \"name\" : \"登录\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688718639967,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"login\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ {\r\n    \"name\" : \"require_login\",\r\n    \"value\" : \"false\",\r\n    \"description\" : \"该接口需要登录才允许访问\",\r\n    \"required\" : false,\r\n    \"dataType\" : \"String\",\r\n    \"type\" : null,\r\n    \"defaultValue\" : null,\r\n    \"validateType\" : null,\r\n    \"error\" : null,\r\n    \"expression\" : null,\r\n    \"children\" : null\r\n  } ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport cn.dev33.satoken.stp.StpUtil;\r\nimport cn.hutool.http.useragent.UserAgentUtil;\r\nimport cn.hutool.http.useragent.UserAgent;\r\nimport com.tansci.utils.Sha256Util;\r\nimport com.tansci.utils.SystemUtils;\r\nimport com.tansci.model.CodeCacheMap;\r\nimport request;\r\n\r\nUserAgent ua = UserAgentUtil.parse(request.getHeaders(\"User-Agent\")[0])\r\n// 判断验证码\r\nif(!body.code || CodeCacheMap.get(body.code) != body.code){\r\n    exit 0, \'验证码有误，请重新获取！\'\r\n}\r\nCodeCacheMap.remove(body.code)\r\n\r\nvar user = db.table(\"sys_user\").where().eq(\"username\",body.username).selectOne();\r\nvar log = {\r\n    username: body.username,\r\n    type: \'成功\',\r\n    ip: request.getClientIP(),\r\n    browser: ua.getBrowser().toString(),\r\n    os: ua.getOs().toString(),\r\n    address: SystemUtils.getAddress(request.getClientIP()),\r\n    message: \'成功\'\r\n}\r\n\r\nif(!user || user.password != Sha256Util.getSHA256(body.password)){\r\n    log.failPassword = body.password\r\n    log.type = \'失败\'\r\n    log.message = \'用户名或密码错误\'\r\n    db.insert(\"\"\"\r\n        insert into sys_login_log(id,username,fail_password,type,browser,os,address,ip,message,create_time) values \r\n        (uuid(),#{log.username},#{log.failPassword},#{log.type},#{log.browser},#{log.os},#{log.address},#{log.ip},#{log.message},now())\r\n    \"\"\")    \r\n    exit 0,\'用户名或密码错误!\'\r\n}\r\n\r\nif(user.isLogin == 1){\r\n    log.type = \"失败\"\r\n    log.message = \"该账号已被禁用\"\r\n    db.insert(\"\"\"\r\n        insert into sys_login_log(id,username,fail_password,type,browser,os,address,ip,message,create_time) values \r\n        (uuid(),#{log.username},#{log.failPassword},#{log.type},#{log.browser},#{log.os},#{log.address},#{log.ip},#{log.message},now())\r\n    \"\"\")\r\n    exit 0,\'该账号已被禁用!\'\r\n}\r\n\r\nStpUtil.login(user.id)\r\nvar token = StpUtil.getTokenValueByLoginId(user.id)\r\nlog.token = token\r\ndb.insert(\"\"\"\r\n    insert into sys_login_log(id,username,fail_password,type,browser,os,address,ip,token,message,create_time) values \r\n    (uuid(),#{log.username},#{log.failPassword},#{log.type},#{log.browser},#{log.os},#{log.address},#{log.ip},#{log.token},#{log.message},now())\r\n\"\"\")\r\nreturn StpUtil.getTokenValueByLoginId(user.id)');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/安全/获取当前用户权限.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"7a1ae4380b62499b83b68312f821e8ef\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"1e5946084f1b47b5aea7fb8b2829c2cd\",\r\n  \"name\" : \"获取当前用户权限\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688712188050,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"permissions\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : null,\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\n\r\nvar userId = StpUtil.getLoginId()\r\nreturn db.select(\"\"\"\r\n    select DISTINCT m.permission \r\n    from sys_menu m\r\n    left join sys_role_menu rm on rm.menu_id = m.id\r\n    left join sys_user_role ur on ur.role_id = rm.role_id \r\n    where m.is_del = 0\r\n    and m.permission != \'\'\r\n    and m.permission IS NOT NULL\r\n    ?{userId && userId != \'1\', and ur.user_id = #{userId}}\r\n\"\"\").map((it) => {return it.permission})');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/安全/获取验证码.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"f1a4ad9f555c43d487773c175fbe5b9f\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"1e5946084f1b47b5aea7fb8b2829c2cd\",\r\n  \"name\" : \"获取验证码\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688718643475,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"code\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ {\r\n    \"name\" : \"require_login\",\r\n    \"value\" : \"false\",\r\n    \"description\" : \"该接口需要登录才允许访问\",\r\n    \"required\" : false,\r\n    \"dataType\" : \"String\",\r\n    \"type\" : null,\r\n    \"defaultValue\" : null,\r\n    \"validateType\" : null,\r\n    \"error\" : null,\r\n    \"expression\" : null,\r\n    \"children\" : null\r\n  } ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : \"{\\n    \\\"code\\\": 500,\\n    \\\"message\\\": \\\"系统内部出现错误\\\",\\n    \\\"result\\\": null\\n}\",\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport cn.hutool.captcha.CaptchaUtil;\r\nimport cn.hutool.captcha.LineCaptcha;\r\nimport java.io.ByteArrayOutputStream;\r\nimport java.io.OutputStream;\r\nimport com.tansci.model.CodeCacheMap;\r\n\r\nvar lineCaptcha = CaptchaUtil.createLineCaptcha(100, 60);\r\nCodeCacheMap.put(lineCaptcha.getCode(),lineCaptcha.getCode())\r\n\r\nOutputStream bOut = new ByteArrayOutputStream();\r\nlineCaptcha.write(bOut)\r\nreturn bOut.toByteArray()');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"fc83134da85f4beaa18511d00d4ff661\",\r\n  \"name\" : \"用户管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"path\" : \"user\",\r\n  \"createTime\" : 1688627065423,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/保存.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"6bdc64e2ac314291a4c6ee857edeb458\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"fc83134da85f4beaa18511d00d4ff661\",\r\n  \"name\" : \"保存\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688699516589,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"save\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar count = db.selectInt(\"\"\"select count(*) from sys_user where username = #{body.username}\"\"\")\r\nif(count > 0){\r\n    exit 500, \'用户名称已存在！\'\r\n}\r\n\r\nvar id = uuid();\r\nvar row = db.insert(\"\"\"\r\n    INSERT INTO sys_user(`id`, `username`, `password`, `nickname`, `type`, `phone`,`avatar`,`gender`,`birthday`,`address`,`email`, `is_del`, `update_time`, `create_time`, `remarks`) \r\n    VALUES \r\n    (#{id}, #{body.username},#{password},#{body.nickname},#{body.type},#{body.phone},#{body.avatar},#{body.gender},#{body.birthday},#{body.address},#{body.email},0,now(),now(),#{body.remarks})\r\n\"\"\")\r\n\r\ndb.insert(\"\"\"insert into sys_user_role(user_id,role_id)values(#{id},#{body.roleId})\"\"\")\r\n\r\nreturn row');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/修改.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"064dd0495efd4c3999e3236cd8f1f94b\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"fc83134da85f4beaa18511d00d4ff661\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688699586759,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"update\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar row = db.update(\"\"\"\r\n    update sys_user set \r\n    update_time = now()\r\n    ?{body.nickname, ,`nickname` = #{body.nickname}}\r\n    ?{body.type, ,`type` = #{body.type}}\r\n    ?{body.phone, ,`phone` = #{body.phone}}\r\n    ?{body.avatar, ,`avatar` = #{body.avatar}}\r\n    ?{body.gender, ,`gender` = #{body.gender}}\r\n    ?{body.birthday, ,`birthday` = #{body.birthday}}\r\n    ?{body.address, ,`address` = #{body.address}}\r\n    ?{body.email, ,`email` = #{body.email}}\r\n    ?{body.isDel != null, ,`is_del` = #{body.isDel}}\r\n    ?{body.isLogin != null, ,`is_login` = #{body.isLogin}}\r\n    ?{body.remarks, ,`remarks` = #{body.remarks}}\r\n    where id = #{body.id}\r\n\"\"\")\r\n\r\nif(body.roleId != null){\r\n    db.update(\"\"\"update sys_user_role set role_id = #{body.roleId} where user_id = #{body.id}\"\"\")\r\n}\r\n\r\nreturn row;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/分页.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"396c586ab1a74de6aad78a0549d57952\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"fc83134da85f4beaa18511d00d4ff661\",\r\n  \"name\" : \"分页\",\r\n  \"createTime\" : 1688627065485,\r\n  \"updateTime\" : 1688517327728,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"page\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.page(\"\"\"\r\n    select u.*,ur.role_id\r\n    from sys_user u\r\n    left join sys_user_role ur on ur.user_id = u.id\r\n    where is_del = 0\r\n    ?{username , and username = #{username}}\r\n    ?{status != null , and status = #{status}}\r\n    ?{phone , and phone = #{phone}}\r\n    ?{name , and name like concat(\'%\',#{name},\'%\')}\r\n    order by update_time desc \r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/列表.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"b2c3b55a5a2e4a23bfc7af17e6143b8f\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"fc83134da85f4beaa18511d00d4ff661\",\r\n  \"name\" : \"列表\",\r\n  \"createTime\" : 1688627065488,\r\n  \"updateTime\" : 1688690611112,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"list\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.select(\"\"\"\r\n    select * from sys_user\r\n    where is_del = 0\r\n    ?{username , and username = #{username}}\r\n    ?{status != null , and status = #{status}}\r\n    ?{phone , and phone = #{phone}}\r\n    ?{name , and name like concat(\'%\',#{name},\'%\')}\r\n    order by update_time desc \r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/删除.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"8370e79fd2694d5f86085f0bd7a0efe8\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"fc83134da85f4beaa18511d00d4ff661\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : 1688627065491,\r\n  \"updateTime\" : 1688517330950,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"delete/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    db.table(\"sys_user\").where().eq(\"id\", id).delete()\r\n    db.table(\"sys_user_role\").where().eq(\"user_id\", id).delete()\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/用户管理/详情.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"01cc62375d6c4a86b050d64e60cf5872\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"fc83134da85f4beaa18511d00d4ff661\",\r\n  \"name\" : \"详情\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688720745924,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"info\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport cn.dev33.satoken.stp.StpUtil;\r\n\r\nvar userId = StpUtil.getLoginId();\r\nvar user = db.table(\"sys_user\").where().eq(\"id\", userId).selectOne();\r\nuser.authorities = db.select(\"\"\"\r\n    select DISTINCT m.permission \r\n    from sys_menu m\r\n    left join sys_role_menu rm on rm.menu_id = m.id\r\n    left join sys_user_role ur on ur.role_id = rm.role_id \r\n    where m.is_del = 0\r\n    and m.permission != \'\'\r\n    and m.permission IS NOT NULL\r\n    ?{userId && userId != \'1\', and ur.user_id = #{userId}}\r\n\"\"\").map((it) => {return it.permission})\r\nreturn user;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/组织管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/组织管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"125a5f6a629d4afdbeca4cd45d3457fe\",\r\n  \"name\" : \"组织管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"path\" : \"org\",\r\n  \"createTime\" : 1688627065434,\r\n  \"updateTime\" : 1688634824150,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/组织管理/保存.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"ffb91faa7d574362ab4e6caf5ee5ea59\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"125a5f6a629d4afdbeca4cd45d3457fe\",\r\n  \"name\" : \"保存\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688690620885,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"save\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar code = uuid().substring(10)\r\nreturn db.insert(\"\"\"\r\n    INSERT INTO sys_org(`id`, `parent_id`, `name`, `code`, `sort`, `is_del`, `update_time`, `create_time`, `remarks`) \r\n    VALUES \r\n    (uuid(), #{body.parentId},#{body.name},#{code},#{body.sort},0,now(),now(),#{body.remarks})\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/组织管理/修改.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"3f8916b149cb447688ae10594819b807\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"125a5f6a629d4afdbeca4cd45d3457fe\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688690626789,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"update\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.update(\"\"\"\r\n    update sys_org set \r\n    update_time = now()\r\n    ?{body.parentId, ,`parent_id` = #{body.parentId}}\r\n    ?{body.name, ,`name` = #{body.name}}\r\n    ?{body.code, ,`code` = #{body.code}}\r\n    ?{body.sort, ,`sort` = #{body.sort}}\r\n    ?{body.is_del, ,`is_del` = #{body.is_del}}\r\n    ?{body.remarks, ,`remarks` = #{body.remarks}}\r\n    where id = #{body.id}\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/组织管理/列表.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"fcec72133bc249cd8174de03e9e393ed\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"125a5f6a629d4afdbeca4cd45d3457fe\",\r\n  \"name\" : \"列表\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688700062821,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"list\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\n\r\nvar userId = StpUtil.getLoginId();\r\n\r\nvar list = db.select(\"\"\"\r\n    select DISTINCT * from (\r\n        with recursive t as (	\r\n            select * from sys_org \r\n            where 1 = 1\r\n            ?{userId && userId != 1, and id = (\r\n                    select ro.org_id\r\n                    from sys_user u\r\n                    left join sys_user_role ur on u.id = ur.user_id\r\n                    left join sys_role_org ro on ur.role_id = ro.role_id \r\n                    where u.id = #{userId}\r\n                )\r\n            }\r\n            union all\r\n            select a.* from sys_org a \r\n            join t on a.parent_id = t.id\r\n        )\r\n        select t.* from t\r\n    ) o\r\n\"\"\")\r\n\r\nif (list.length == 1) {\r\n    return list;\r\n}\r\nlist.filter(item => {\r\n    var arr = list.filter(child => item.id == child.parentId);\r\n    arr.length > 0 ? (item.children = arr) : false;\r\n    return item.parentId == 0;\r\n})\r\n\r\nreturn list.filter(item => item.parentId == 0);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/组织管理/删除.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"9bf5a6729ad345b1b79eddd263dc84af\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"125a5f6a629d4afdbeca4cd45d3457fe\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688690624815,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"delete/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    var list = db.select(\"\"\"\r\n        with recursive t as (	\r\n            select id from sys_org where id = #{id}\r\n            union all\r\n            select a.id from sys_org a \r\n            join t on a.parent_id = t.id\r\n        )\r\n        select id from t\r\n    \"\"\")\r\n\r\n    for(item in list){\r\n        db.table(\"sys_org\").where().eq(\"id\", item.id).delete()\r\n    }\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/菜单管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/菜单管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"67b2ce258e24491194b74992958c74aa\",\r\n  \"name\" : \"菜单管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"path\" : \"/menu\",\r\n  \"createTime\" : 1688627065445,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/菜单管理/保存.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"cb156d8c8c38401eb8405ddb80de2d30\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"67b2ce258e24491194b74992958c74aa\",\r\n  \"name\" : \"保存\",\r\n  \"createTime\" : 1688627065511,\r\n  \"updateTime\" : 1688517299257,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"save\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.insert(\"\"\"\r\n    INSERT INTO sys_menu(`id`, `parent_id`, `name`, `url`, `icon`, `chinese_name`, `english_name`, `permission`, `sort`, `component`, `component_type`, `open_mode`, `is_del`, `keep_alive`, `is_show`, `update_time`, `create_time`, `remarks`) \r\n    VALUES \r\n    (uuid(), #{body.parentId},#{body.name},#{body.url},#{body.icon},#{body.chineseName},#{body.englishName},#{body.permission},#{body.sort},#{body.component},#{body.componentType},#{body.openMode},0,#{body.keepAlive},#{body.isShow},now(),now(),#{body.remarks})\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/菜单管理/修改.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"30ec3c62eca74e5695f2f96ddd6c1e10\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"67b2ce258e24491194b74992958c74aa\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : 1688627065519,\r\n  \"updateTime\" : 1688517306762,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"update\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.update(\"\"\"\r\n    update sys_menu set \r\n    update_time = now()\r\n    ?{body.parentId, ,`parent_id` = #{body.parentId}}\r\n    ?{body.name, ,`name` = #{body.name}}\r\n    ?{body.url, ,`url` = #{body.url}}\r\n    ?{body.icon, ,`icon` = #{body.icon}}\r\n    ?{body.chineseName, ,`chinese_name` = #{body.chineseName}}\r\n    ?{body.englishName, ,`english_name` = #{body.englishName}}\r\n    ?{body.permission, ,`permission` = #{body.permission}}\r\n    ?{body.sort, ,`sort` = #{body.sort}}\r\n    ?{body.component, ,`component` = #{body.component}}\r\n    ?{body.componentType, ,`component_type` = #{body.componentType}}\r\n    ?{body.openMode != null, ,`open_mode` = #{body.openMode}}\r\n    ?{body.isDel != null, ,`is_del` = #{body.isDel}}\r\n    ?{body.keepAlive != null, ,`keep_alive` = #{body.keepAlive}}\r\n    ?{body.isShow != null, ,`is_show` = #{body.isShow}}\r\n    ?{body.remarks, ,`remarks` = #{body.remarks}}\r\n    where id = #{body.id}\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/菜单管理/删除.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"26ff3d166de34575a3bf6d41465c80e7\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"67b2ce258e24491194b74992958c74aa\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : 1688627065524,\r\n  \"updateTime\" : 1688517304774,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"delete/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    var list = db.select(\"\"\"\r\n        with recursive t as (	\r\n            select id from sys_menu where id = #{id}\r\n            union all\r\n            select a.id from sys_menu a \r\n            join t on a.parent_id = t.id\r\n        )\r\n        select id from t\r\n    \"\"\")\r\n\r\n    for(item in list){\r\n        db.table(\"sys_menu\").where().eq(\"id\", item.id).delete()\r\n        db.table(\"sys_role_menu\").where().eq(\"menu_id\", item.id)\r\n    }\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/菜单管理/菜单树.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"f90132707c3e401c926eaf2ada6ec81a\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"67b2ce258e24491194b74992958c74aa\",\r\n  \"name\" : \"菜单树\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688721005404,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"tree\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\n\r\nvar userId = StpUtil.getLoginId();\r\n\r\nvar menus = db.select(\"\"\"\r\n    select m.* \r\n    from sys_menu m\r\n    where m.is_del = 0\r\n    ?{isShow  != null, and m.is_show = #{isShow}}\r\n    ?{userId && userId != 1, and m.id in (\r\n        select rm.menu_id \r\n        from sys_role_menu rm\r\n        left join sys_user_role ur on ur.role_id = rm.role_id\r\n        where ur.user_id = #{userId})\r\n    }\r\n    order by sort asc\r\n\"\"\")\r\n\r\nif (menus.length == 1) {\r\n    return menus;\r\n}\r\nmenus.filter(item => {\r\n    var arr = menus.filter(child => item.id == child.parentId);\r\n    arr.length > 0 ? (item.children = arr) : false;\r\n    return item.parentId == 0;\r\n})\r\n\r\nreturn menus.filter(item => item.parentId == 0);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/菜单管理/菜单路由.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"62020bd7a49949378e90ce2d14fef8f7\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"67b2ce258e24491194b74992958c74aa\",\r\n  \"name\" : \"菜单路由\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1689229170425,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"menus\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\n\r\nvar userId = StpUtil.getLoginId();\r\n\r\nvar list = db.select(\"\"\"\r\n    select m.* \r\n    from sys_menu m\r\n    where m.is_del = 0\r\n    and m.is_show = 1\r\n    ?{userId && userId != 1, and m.id in (\r\n        select rm.menu_id \r\n        from sys_role_menu rm\r\n        left join sys_user_role ur on ur.role_id = rm.role_id\r\n        where ur.user_id = #{userId})\r\n    }\r\n    order by sort asc\r\n\"\"\")\r\n\r\nvar menus = []\r\nlist.each(item => {\r\n    menus.push({\r\n        id: item.id,\r\n        parentId: item.parentId,\r\n        path: item.url,\r\n        name: item.name,\r\n        icon: item.icon,\r\n        sort: item.sort,\r\n        component: item.component == null || item.component == \'\' ? \"Layout\" : item.component,\r\n        componentType: item.componentType,\r\n        isShow: item.isShow,\r\n        meta: {\r\n            title: item.chineseName,\r\n            keepAlive: item.keepAlive,\r\n            isShow: item.isShow,\r\n            id: item.id,\r\n            openMode: item.openMode,\r\n            type: item.componentType,\r\n        }\r\n    })\r\n})\r\n\r\nif (menus.length == 1) {\r\n    return menus;\r\n}\r\nmenus.filter(item => {\r\n    var arr = menus.filter(child => item.id == child.parentId);\r\n    arr.length > 0 ? (item.children = arr) : false;\r\n    return item.parentId == 0;\r\n})\r\n\r\nvar _menus = menus.filter(item => item.parentId == 0);\r\n_menus.each(item=>{\r\n    if(!item.children){\r\n        item.children = [{\r\n            id: item.id,\r\n            parentId: item.parentId,\r\n            path: item.path,\r\n            name: item.name,\r\n            icon: item.icon,\r\n            sort: item.sort,\r\n            component: item.component,\r\n            componentType: item.componentType,\r\n            isShow: item.isShow,\r\n            meta: item.meta\r\n        }]\r\n        item.componentType = 0;\r\n    }\r\n})\r\n\r\n\r\nreturn _menus;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/group.json', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"角色管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"path\" : \"role\",\r\n  \"createTime\" : 1688627065453,\r\n  \"updateTime\" : null,\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"paths\" : [ ],\r\n  \"options\" : [ ]\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/保存.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"963fbdab7f1e4c5482d94467994e076b\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"保存\",\r\n  \"createTime\" : 1688627065553,\r\n  \"updateTime\" : 1688517313199,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"save\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar code = uuid().substring(0,10)\r\nreturn db.insert(\"\"\"\r\n    INSERT INTO sys_role(`id`, `name`, `code`, `permission`, `sort`, `is_del`, `creator`, `update_time`, `create_time`, `remarks`) \r\n    VALUES \r\n    (uuid(), #{body.name},#{code},#{body.permission},#{body.sort},0,#{body.creator},now(),now(),#{body.remarks})\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/修改.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"62c0822e34124adcb52c79d9f2e128f3\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : 1688627065559,\r\n  \"updateTime\" : 1688517323756,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"update\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.update(\"\"\"\r\n    update sys_role set \r\n    update_time = now()\r\n    ?{body.name, ,`name` = #{body.name}}\r\n    ?{body.code, ,`code` = #{body.code}}\r\n    ?{body.sort, ,`sort` = #{body.sort}}\r\n    ?{body.is_del, ,`is_del` = #{body.is_del}}\r\n    ?{body.permission, ,`permission` = #{body.permission}}\r\n    ?{body.remarks, ,`remarks` = #{body.remarks}}\r\n    where id = #{body.id}\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/分页.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"d8a1114e2da54d7c857d4c54d5bc5880\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"分页\",\r\n  \"createTime\" : 1688627065564,\r\n  \"updateTime\" : 1688517316978,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"page\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.page(\"\"\"\r\n    select * from sys_role\r\n    where is_del = 0\r\n    ?{code , and code = #{code}}\r\n    ?{name , and name like concat(\'%\',#{name},\'%\')}\r\n    order by sort \r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/列表.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"71851668125c451f9e322f0c5f7828a8\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"列表\",\r\n  \"createTime\" : 1688627065570,\r\n  \"updateTime\" : 1688517320177,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"list\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nreturn db.select(\"\"\"\r\n    select * from sys_role\r\n    where is_del = 0\r\n    ?{code , and code = #{code}}\r\n    ?{name , and name like concat(\'%\',#{name},\'%\')}\r\n    order by sort \r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/删除.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"f3450863db7c4600b8fb199e5c07eaec\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688698546137,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"delete/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    db.table(\"sys_role\").where().eq(\"id\", id).delete()\r\n    db.table(\"sys_role_menu\").where().eq(\"role_id\", id).delete()\r\n    db.table(\"sys_user_role\").where().eq(\"role_id\", id).delete()\r\n    db.table(\"sys_user_org\").where().eq(\"role_id\", id).delete()\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/数据权限.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"06ca5c4e8ce04fbc85bece6274208bec\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"数据权限\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688698471253,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"dataPermissions\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    db.table(\"sys_role_org\").where().eq(\"role_id\", body.id).delete()\r\n\r\n    for(item in body.orgIds){\r\n        db.insert(\"\"\"INSERT INTO sys_role_org (role_id,org_id) VALUES (#{body.id}, #{item})\"\"\")\r\n    }\r\n\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/获取权限组织.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"9ea9a1c0a8a24a6e9e9b584c87d94a28\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"获取权限组织\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1688698474013,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"orgList/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'@get:/system/org/list\' as getOrg;\r\n\r\nvar list = db.select(\"\"\"select * from sys_role_org where role_id = #{id}\"\"\");\r\nvar selected = list.map((item) =>{\r\n    return item.orgId\r\n})\r\nreturn {\r\n    list: getOrg(),\r\n    selected: selected\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/获取权限菜单.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"95c1495b484e4f06ab5f1399e45fb643\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"获取权限菜单\",\r\n  \"createTime\" : 1688627065578,\r\n  \"updateTime\" : 1688517318645,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"menuList/{id}\",\r\n  \"method\" : \"GET\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport \'@get:/system/menu/tree\' as getTree;\r\n\r\nvar list = db.select(\"\"\"select * from sys_role_menu where role_id = #{id}\"\"\");\r\n\r\nvar ids = list.map((item) =>{\r\n    return item.menuId\r\n})\r\n\r\nreturn {\r\n    list: getTree(),\r\n    selected: ids\r\n}');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/角色管理/菜单权限.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"e6b1376d15e44edea70becac58caeb35\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"e3e7b79651ef4023bf808869bda70162\",\r\n  \"name\" : \"菜单权限\",\r\n  \"createTime\" : 1688627065583,\r\n  \"updateTime\" : 1688517315336,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : \"admin\",\r\n  \"path\" : \"menuPermissions\",\r\n  \"method\" : \"POST\",\r\n  \"parameters\" : [ ],\r\n  \"options\" : [ ],\r\n  \"requestBody\" : \"\",\r\n  \"headers\" : [ ],\r\n  \"paths\" : [ ],\r\n  \"responseBody\" : null,\r\n  \"description\" : null,\r\n  \"requestBodyDefinition\" : null,\r\n  \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nvar val = db.transaction(()=>{\r\n    db.table(\"sys_role_menu\").where().eq(\"role_id\", body.id).delete()\r\n\r\n    for(item in body.menuIds){\r\n        db.insert(\"\"\"INSERT INTO sys_role_menu (role_id,menu_id) VALUES (#{body.id}, #{item})\"\"\")\r\n    }\r\n\r\n    return \"OK\"\r\n});\r\n\r\nreturn val;');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/datasource/', 'this is directory');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/function/', 'this is directory');

-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键id',
  `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '父ID',
  `group_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '分组名称',
  `type` int NULL DEFAULT NULL COMMENT '类型：0、系统，1、业务',
  `dic_value` int NOT NULL COMMENT '值',
  `dic_label` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '名称',
  `sort` int NULL DEFAULT NULL COMMENT '排序',
  `text1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '预留字段1',
  `text2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '预留字段2',
  `text3` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '预留字段3',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `group_name`(`group_name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '字典表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_dict
-- ----------------------------
INSERT INTO `sys_dict` VALUES ('3048f7228cf80e7f366b60f7138ce1ef', '46de04fc892b613abe4a5ecb88f4cd47', 'oper_log_status', 1, 0, '成功', 1, NULL, NULL, NULL, '2023-04-14 14:41:26', '2023-04-14 10:36:18', '操作成功');
INSERT INTO `sys_dict` VALUES ('3292493cc1195fc6ad1934e19d4bab2f', '7afe0187e05ce3465c810a49331babc8', 'user_type', 1, 1, '管理员', 1, NULL, NULL, NULL, '2023-04-14 15:40:40', '2023-04-14 15:40:40', '管理员');
INSERT INTO `sys_dict` VALUES ('402ab9a354ff5f9de90adb9e9afb33fb', '0', 'user_gender', 1, -1, '用户性别', 0, NULL, NULL, NULL, '2023-04-14 15:39:38', '2023-04-14 15:39:38', '用户性别');
INSERT INTO `sys_dict` VALUES ('46de04fc892b613abe4a5ecb88f4cd47', '0', 'oper_log_status', 1, -1, '操作日志状态', 0, NULL, NULL, NULL, '2023-04-14 10:35:49', '2023-04-14 10:35:49', '操作日志状态');
INSERT INTO `sys_dict` VALUES ('504f58ac31fd50cd0f250d4bd165bf0b', '0', 'business_type', 0, -1, '业务类型', 0, NULL, NULL, NULL, '2023-04-14 15:34:37', '2023-04-14 15:34:37', '业务类型');
INSERT INTO `sys_dict` VALUES ('565a9c6f24904ec7a4f084fa96c5434b', '7afe0187e05ce3465c810a49331babc8', 'user_type', 1, 2, '普通用户', 2, NULL, NULL, NULL, '2023-04-14 15:41:07', '2023-04-14 15:41:07', '普通用户');
INSERT INTO `sys_dict` VALUES ('7afe0187e05ce3465c810a49331babc8', '0', 'user_type', 1, -1, '用户类型', 0, NULL, NULL, NULL, '2023-04-14 15:39:15', '2023-04-14 15:39:15', '用户类型');
INSERT INTO `sys_dict` VALUES ('ba3ed2cc3a8c450f8a150ee5bbb09abe', '46de04fc892b613abe4a5ecb88f4cd47', 'oper_log_status', 1, 1, '失败', 2, NULL, NULL, NULL, '2023-04-14 14:41:31', '2023-04-14 10:36:43', '操作失败');
INSERT INTO `sys_dict` VALUES ('bd4b42486c1b522b07cec0d870834952', '402ab9a354ff5f9de90adb9e9afb33fb', 'user_gender', 1, 1, '女', 2, NULL, NULL, NULL, '2023-04-14 15:41:57', '2023-04-14 15:41:57', '女');
INSERT INTO `sys_dict` VALUES ('c7d736d70f722d15bebe282f4bd317d5', '504f58ac31fd50cd0f250d4bd165bf0b', 'business_type', 0, 1, '业务', 1, NULL, NULL, NULL, '2023-04-14 15:35:36', '2023-04-14 15:35:36', '');
INSERT INTO `sys_dict` VALUES ('df5903139958429ed65ee82424d69b1b', '402ab9a354ff5f9de90adb9e9afb33fb', 'user_gender', 1, 0, '男', 1, NULL, NULL, NULL, '2023-04-14 15:41:44', '2023-04-14 15:40:09', '男');
INSERT INTO `sys_dict` VALUES ('f60b86ff25cc5261dafdffdf78b590db', '504f58ac31fd50cd0f250d4bd165bf0b', 'business_type', 0, 0, '系统', 1, NULL, NULL, NULL, '2023-04-14 15:35:23', '2023-04-14 15:35:23', '');

-- ----------------------------
-- Table structure for sys_gen
-- ----------------------------
DROP TABLE IF EXISTS `sys_gen`;
CREATE TABLE `sys_gen`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
  `interface_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '接口ID',
  `data_source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '数据源',
  `table_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '表名',
  `table_comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '表注释',
  `columns` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '字段信息json',
  `sub_table_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字表名称',
  `sub_table_comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '子表注释',
  `sub_columns` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '子表字段信息json',
  `info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '生成信息json',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '生成表信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_gen
-- ----------------------------
INSERT INTO `sys_gen` VALUES ('a54cb7225aa84346843957cb3299ed1f', 'ee837d9cf48a4136bd4b596a1079ca87', 'tansci_boot', 'magic_api_backup', 'magic api 备份', '[{\"tableSchema\":\"tansci_boot\",\"tableName\":\"magic_api_backup\",\"columnName\":\"content\",\"columnComment\":\"备份内容\",\"columnKey\":\"\",\"dataType\":\"blob\",\"isNullable\":\"YES\",\"columnType\":\"blob\",\"columnLength\":\"65535\"},{\"tableSchema\":\"tansci_boot\",\"tableName\":\"magic_api_backup\",\"columnName\":\"create_by\",\"columnComment\":\"操作人\",\"columnKey\":\"\",\"dataType\":\"varchar\",\"isNullable\":\"YES\",\"columnType\":\"varchar(255)\",\"columnLength\":\"255\"},{\"tableSchema\":\"tansci_boot\",\"tableName\":\"magic_api_backup\",\"columnName\":\"create_date\",\"columnComment\":\"备份时间\",\"columnKey\":\"\",\"dataType\":\"datetime\",\"isNullable\":\"YES\",\"columnType\":\"datetime\",\"columnLength\":null},{\"tableSchema\":\"tansci_boot\",\"tableName\":\"magic_api_backup\",\"columnName\":\"id\",\"columnComment\":\"原对象ID\",\"columnKey\":\"PRI\",\"dataType\":\"varchar\",\"isNullable\":\"NO\",\"columnType\":\"varchar(32)\",\"columnLength\":\"32\"},{\"tableSchema\":\"tansci_boot\",\"tableName\":\"magic_api_backup\",\"columnName\":\"name\",\"columnComment\":\"原名称\",\"columnKey\":\"\",\"dataType\":\"varchar\",\"isNullable\":\"YES\",\"columnType\":\"varchar(255)\",\"columnLength\":\"255\"},{\"tableSchema\":\"tansci_boot\",\"tableName\":\"magic_api_backup\",\"columnName\":\"tag\",\"columnComment\":\"标签\",\"columnKey\":\"\",\"dataType\":\"varchar\",\"isNullable\":\"YES\",\"columnType\":\"varchar(32)\",\"columnLength\":\"32\"},{\"tableSchema\":\"tansci_boot\",\"tableName\":\"magic_api_backup\",\"columnName\":\"type\",\"columnComment\":\"类型\",\"columnKey\":\"\",\"dataType\":\"varchar\",\"isNullable\":\"YES\",\"columnType\":\"varchar(255)\",\"columnLength\":\"255\"}]', NULL, NULL, '[]', '{\"moduleName\":\"api\",\"modulePath\":\"/api\",\"businessName\":\"test\",\"businessPath\":\"/test\",\"template\":\"single\",\"pid\":\"\",\"treeId\":\"\",\"treePid\":\"\",\"subTable\":\"\",\"subTableKey\":\"\"}', NULL, '2023-04-28 15:09:03');

-- ----------------------------
-- Table structure for sys_login_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_login_log`;
CREATE TABLE `sys_login_log`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '登录账号',
  `fail_password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '失败密码',
  `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '登录类型（成功、失败）',
  `browser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '浏览器',
  `os` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作系统',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '地理位置',
  `ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'ip地址',
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'token',
  `message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '失败原因',
  `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_login_log
-- ----------------------------

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
  `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '父id',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单名称',
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单链接',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '图标',
  `chinese_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '中文名称',
  `english_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '英文名称',
  `permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '权限',
  `sort` int NULL DEFAULT NULL COMMENT '排序',
  `component` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '组件名称',
  `component_type` int NULL DEFAULT 0 COMMENT '组件类型：0、默认，1、amis',
  `open_mode` int NULL DEFAULT 0 COMMENT '打开方式：0、默认，1、iframe，2、新标签页',
  `is_del` int NULL DEFAULT 0 COMMENT '是否删除：0、未删除，1、已删除',
  `keep_alive` int NULL DEFAULT NULL COMMENT '是否缓存：0、不缓存，1、缓存',
  `is_show` int NULL DEFAULT NULL COMMENT '是否显示：1显示，0不显示',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES ('06936eec3258c1fa675c8b6b697160f5', '1ec1c1cb127d83f6346904220b3ed20b', '', '', '', '列表', '', 'dict:list', 0, '', 0, 0, 0, 0, 0, '2023-04-13 16:26:51', '2023-04-13 16:26:51', '');
INSERT INTO `sys_menu` VALUES ('07e1aebb5b69b55b7eb0ce79fed00f40', 'b1851d1b13594e71840103c11a37a004', '', '', '', '列表', '', 'org:list', 3, '', 0, 0, 0, 0, 0, '2023-04-13 10:35:47', '2023-04-13 10:35:47', '');
INSERT INTO `sys_menu` VALUES ('0a59255aac53f421613c4d8516fcc305', '1cda1e6f35077cb1f89007fa36343a3d', '', '', '', '保存', '', 'pages:save', 0, NULL, 0, 0, 0, 0, 0, '2023-05-11 11:16:50', '2023-05-11 11:16:50', '');
INSERT INTO `sys_menu` VALUES ('0e769d6164cff598ae7215c99849bd1c', '1cda1e6f35077cb1f89007fa36343a3d', '', '', '', '删除', '', 'pages:delete', 2, NULL, 0, 0, 0, 0, 0, '2023-05-11 11:17:35', '2023-05-11 11:17:35', '');
INSERT INTO `sys_menu` VALUES ('11107c717306bd0d9e993cf32a94974e', 'b1851d1b13594e71840103c11a37a006', '', '', '', '删除', '', 'user:delete', 3, NULL, 0, 0, 0, 0, 0, '2023-04-13 11:34:29', '2023-04-13 11:34:29', NULL);
INSERT INTO `sys_menu` VALUES ('120d967459a9e7323692b3fa49c1ba59', '0', 'monitor', '/monitor', 'Odometer', '系统监控', 'Monitor', NULL, 3, NULL, 0, 0, 0, 1, 1, '2023-04-14 08:44:27', '2023-04-14 08:44:27', '');
INSERT INTO `sys_menu` VALUES ('1cda1e6f35077cb1f89007fa36343a3d', 'b25838d6e06c6cdad82c1ad9b1096f26', 'lcPages', '/lowcode/LcPages', 'Ticket', '页面管理', 'LcPages', NULL, 1, NULL, 0, 0, 0, 1, 1, '2023-07-07 17:07:55', '2023-05-11 10:52:58', '');
INSERT INTO `sys_menu` VALUES ('1ec1c1cb127d83f6346904220b3ed20b', 'b1851d1b13594e71840103c11a37a002', 'dict', '/system/Dict', 'Coin', '字典管理', 'Dist', NULL, 5, NULL, 0, 0, 0, 0, 1, '2023-04-13 16:26:19', '2023-04-13 16:26:19', NULL);
INSERT INTO `sys_menu` VALUES ('3afbad18e475a7f7a4aeec6ab6e6c0fc', '1cda1e6f35077cb1f89007fa36343a3d', '', '', '', '修改', '', 'pages:update', 1, NULL, 0, 0, 0, 0, 0, '2023-05-11 11:17:13', '2023-05-11 11:17:13', '');
INSERT INTO `sys_menu` VALUES ('44979f524b88ed2dfbf14e4267ebd045', 'b1851d1b13594e71840103c11a37a004', '', '', '', '删除', '', 'org:delete', 1, '', 0, 0, 0, 0, 0, '2023-04-13 10:34:53', '2023-04-13 10:34:53', '');
INSERT INTO `sys_menu` VALUES ('5de088a93f0828a57e4c70959831458b', 'b1851d1b13594e71840103c11a37a004', '', '', '', '保存', '', 'org:save', 0, '', 0, 0, 0, 0, 0, '2023-04-13 10:33:43', '2023-04-13 10:33:43', '');
INSERT INTO `sys_menu` VALUES ('5df7c65d51129baefee123ef3bc2d7de', 'ea83fb03d2117cb287973d6889984686', 'magicapi', 'https://www.ssssssss.org/magic-api/pages/quick/single/', 'Clock', '框架', 'magicapi', NULL, 2, '', 0, 1, 0, 0, 1, '2023-04-11 11:25:08', '2023-04-11 11:25:08', NULL);
INSERT INTO `sys_menu` VALUES ('5e67672047d0a00bf861ba2255535238', '1ec1c1cb127d83f6346904220b3ed20b', '', '', '', '修改', '', 'dict:update', 2, '', 0, 0, 0, 0, 0, '2023-04-13 16:27:29', '2023-04-13 16:27:29', '');
INSERT INTO `sys_menu` VALUES ('628431d108e3530ac37dfa2180dff376', '1ec1c1cb127d83f6346904220b3ed20b', '', '', '', '保存', '', 'dict:save', 1, '', 0, 0, 0, 0, 0, '2023-04-13 16:27:07', '2023-04-13 16:27:07', '');
INSERT INTO `sys_menu` VALUES ('7b02ec134bcd2a74b7930ce03da4b8bb', '120d967459a9e7323692b3fa49c1ba59', 'loginLog', '/monitor/LoginLog', 'User', '登录日志', 'LoginLog', NULL, 1, NULL, 0, 0, 0, 1, 1, '2023-04-14 08:48:07', '2023-04-14 08:48:07', '');
INSERT INTO `sys_menu` VALUES ('850a1c29af28318e6e470a14aaeb50e5', 'b1851d1b13594e71840103c11a37a006', '', '', '', '保存', '', 'user:save', 0, '', 0, 0, 0, 0, 0, '2023-04-13 11:33:37', '2023-04-13 11:33:37', '');
INSERT INTO `sys_menu` VALUES ('9658b61b187ae33b7c8c39fc8c1265dc', '120d967459a9e7323692b3fa49c1ba59', 'onlineUser', '/monitor/OnlineUser', 'Avatar', '在线用户', 'OnlineUser', NULL, 3, NULL, 0, 0, 0, 1, 1, '2023-04-14 08:50:35', '2023-04-14 08:50:35', '');
INSERT INTO `sys_menu` VALUES ('9a36ed1841e3e6d2da32df17980edaa2', 'b25838d6e06c6cdad82c1ad9b1096f26', 'interface', '/lowcode/Interface', 'Connection', '接口开发', 'Interface', NULL, 2, NULL, 0, 0, 0, 1, 1, '2023-07-07 17:08:04', '2023-04-14 08:52:17', '');
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a002', '0', 'system', '/system', 'Tools', '系统管理', 'System', NULL, 1, NULL, 0, 0, 0, 0, 1, '2023-03-29 08:57:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a003', 'b1851d1b13594e71840103c11a37a002', 'menu', '/system/Menu', 'Grid', '菜单管理', 'Menu', NULL, 2, NULL, 0, 0, 0, 0, 1, '2023-03-29 08:57:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a004', 'b1851d1b13594e71840103c11a37a002', 'org', '/system/Org', 'SetUp', '组织管理', 'Org', NULL, 3, NULL, 0, 0, 0, 0, 1, '2023-04-13 11:30:56', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a005', 'b1851d1b13594e71840103c11a37a002', 'role', '/system/Role', 'Help', '角色管理', 'Role', NULL, 4, NULL, 0, 0, 0, 0, 1, '2023-04-13 11:32:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a006', 'b1851d1b13594e71840103c11a37a002', 'user', '/system/User', 'User', '用户管理', 'User', NULL, 5, NULL, 0, 0, 0, 0, 1, '2023-04-13 11:32:34', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a007', 'b1851d1b13594e71840103c11a37a003', NULL, NULL, NULL, '保存', 'save', 'menu:save', 6, NULL, 0, 0, 0, 0, 0, '2023-03-29 08:57:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a008', 'b1851d1b13594e71840103c11a37a003', NULL, NULL, NULL, '删除', 'delete', 'menu:delete', 6, NULL, 0, 0, 0, 0, 0, '2023-03-29 08:57:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a009', 'b1851d1b13594e71840103c11a37a003', NULL, NULL, NULL, '修改', 'update', 'menu:update', 6, NULL, 0, 0, 0, 0, 0, '2023-03-29 08:57:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a010', 'b1851d1b13594e71840103c11a37a003', NULL, NULL, NULL, '详情', 'view', 'menu:view', 6, NULL, 0, 0, 0, 0, 0, '2023-03-29 08:57:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b1851d1b13594e71840103c11a37a011', 'b1851d1b13594e71840103c11a37a003', NULL, NULL, NULL, '列表', 'list', 'menu:list', 6, NULL, 0, 0, 0, 0, 0, '2023-03-29 08:57:50', '2023-03-29 08:57:52', NULL);
INSERT INTO `sys_menu` VALUES ('b25838d6e06c6cdad82c1ad9b1096f26', '0', 'lowcode', '/lowcode', 'Edit', '应用开发', 'Lowcode', NULL, 2, NULL, 0, 0, 0, 1, 1, '2023-07-07 17:06:37', '2023-04-14 08:46:15', '');
INSERT INTO `sys_menu` VALUES ('b4cfa05bff2269fee06788b32115851a', 'b1851d1b13594e71840103c11a37a006', '', '', '', '修改', '', 'user:update', 1, '', 0, 0, 0, 0, 0, '2023-04-13 14:44:51', '2023-04-13 11:34:04', '');
INSERT INTO `sys_menu` VALUES ('b8db9ff560e383e59d604e19c9fbd3cb', 'b1851d1b13594e71840103c11a37a006', '', '', '', '列表', '', 'user:list', 4, '', 0, 0, 0, 0, 0, '2023-04-13 11:34:49', '2023-04-13 11:34:49', '');
INSERT INTO `sys_menu` VALUES ('b9401c42bc1e58e0a48e6b3308cff617', '1ec1c1cb127d83f6346904220b3ed20b', '', '', '', '删除', '', 'dict:delete', 4, '', 0, 0, 0, 0, 0, '2023-04-13 16:27:48', '2023-04-13 16:27:48', '');
INSERT INTO `sys_menu` VALUES ('d2df5734-1ca6-11ee-8b16-e0be038740d4', 'ea83fb03d2117cb287973d6889984686', 'table', '/table', 'Camera', '表格示例', 'table', NULL, 3, NULL, 1, 0, 0, 1, 1, '2023-07-07 17:15:32', '2023-07-07 17:15:32', '');
INSERT INTO `sys_menu` VALUES ('ea83fb03d2117cb287973d6889984686', '0', 'demo', '/demo', 'ChromeFilled', '菜单实例', 'Demo', NULL, 5, '', 0, 0, 0, 1, 1, '2023-07-07 17:06:06', '2023-04-11 11:10:46', '实例');
INSERT INTO `sys_menu` VALUES ('eb404f1c-1ca6-11ee-8b16-e0be038740d4', 'ea83fb03d2117cb287973d6889984686', 'images', '/images', 'Football', '轮播图', 'images', NULL, 4, NULL, 1, 0, 0, 1, 1, '2023-07-07 17:16:13', '2023-07-07 17:16:13', '');
INSERT INTO `sys_menu` VALUES ('f3138bd5b256d82f9eebe07c6679cf15', 'b1851d1b13594e71840103c11a37a004', '', '', '', '修改', '', 'org:update', 2, '', 0, 0, 0, 0, 0, '2023-04-13 10:35:17', '2023-04-13 10:35:17', '');
INSERT INTO `sys_menu` VALUES ('f8b972bc005a9c6691a43b76839b0666', 'b1851d1b13594e71840103c11a37a005', NULL, NULL, NULL, '列表', 'list', 'role:list', 1, '', 0, 0, 0, 0, 0, '2023-04-11 11:26:05', '2023-04-11 11:12:16', NULL);
INSERT INTO `sys_menu` VALUES ('f8b972bc005a9c6691a43b76839b0667', 'b1851d1b13594e71840103c11a37a005', NULL, NULL, NULL, '添加', 'save', 'role:save', 1, '', 0, 0, 0, 0, 0, '2023-04-11 11:26:05', '2023-04-11 11:12:16', NULL);
INSERT INTO `sys_menu` VALUES ('f8b972bc005a9c6691a43b76839b0668', 'b1851d1b13594e71840103c11a37a005', NULL, NULL, NULL, '修改', 'update', 'role:update', 1, '', 0, 0, 0, 0, 0, '2023-04-11 11:26:05', '2023-04-11 11:12:16', NULL);
INSERT INTO `sys_menu` VALUES ('f8b972bc005a9c6691a43b76839b0669', 'b1851d1b13594e71840103c11a37a005', NULL, NULL, NULL, '删除', 'delete', 'role:delete', 1, '', 0, 0, 0, 0, 0, '2023-04-11 11:26:05', '2023-04-11 11:12:16', NULL);
INSERT INTO `sys_menu` VALUES ('f8b972bc005a9c6691a43b76839b0670', 'b1851d1b13594e71840103c11a37a005', NULL, NULL, NULL, '菜单权限', 'menu', 'role:menu', 1, '', 0, 0, 0, 0, 0, '2023-04-11 11:26:05', '2023-04-11 11:12:16', NULL);
INSERT INTO `sys_menu` VALUES ('f8b972bc005a9c6691a43b76839b0671', 'b1851d1b13594e71840103c11a37a005', NULL, NULL, NULL, '数据权限', 'data', 'role:data', 1, '', 0, 0, 0, 0, 0, '2023-04-11 11:26:05', '2023-04-11 11:12:16', NULL);
INSERT INTO `sys_menu` VALUES ('f8b972bc005a9c6691a43b76839b0675', 'ea83fb03d2117cb287973d6889984686', 'Iframe', 'https://www.bing.com/?mkt=zh-CN', 'Bicycle', '必应', 'Iframe', NULL, 1, '', 0, 1, 0, 0, 1, '2023-04-11 11:26:05', '2023-04-11 11:12:16', NULL);
INSERT INTO `sys_menu` VALUES ('fdaf429afb33d54beeee7eaea93e5e96', '120d967459a9e7323692b3fa49c1ba59', 'operLog', '/monitor/OperLog', 'Cpu', '操作日志', 'OperLog', NULL, 2, NULL, 0, 0, 0, 1, 1, '2023-04-14 08:49:04', '2023-04-14 08:49:04', '');

-- ----------------------------
-- Table structure for sys_oper_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_oper_log`;
CREATE TABLE `sys_oper_log`  (
  `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键id',
  `module` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '功能模块',
  `method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作方法',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作类型',
  `message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作描述',
  `req_param` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
  `res_param` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '响应参数',
  `take_up_time` int NULL DEFAULT NULL COMMENT '耗时',
  `user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作用户id',
  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作用户名称',
  `status` int NULL DEFAULT NULL COMMENT '状态：0、成功，1、失败',
  `uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求url',
  `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求IP',
  `unusual` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '异常信息',
  `version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '版本号',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作日志' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_oper_log
-- ----------------------------

-- ----------------------------
-- Table structure for sys_org
-- ----------------------------
DROP TABLE IF EXISTS `sys_org`;
CREATE TABLE `sys_org`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键id',
  `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '父id',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '名称',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '组织机构编码',
  `sort` int NULL DEFAULT NULL COMMENT '排序',
  `is_del` int(1) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT '删除状态：0、正常，1、删除',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '组织' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_org
-- ----------------------------
INSERT INTO `sys_org` VALUES ('534a37c366ec47878a6b0c85703d0001', '534a37c366ec47878a6b0c85703d0bc4', '兰州子公司', 'SO00002', 2, 0, '2023-03-29 08:53:41', '2023-03-29 08:53:43', NULL);
INSERT INTO `sys_org` VALUES ('534a37c366ec47878a6b0c85703d0bc4', '0', '总公司', 'SO00001', 0, 0, '2023-03-29 08:53:41', '2023-03-29 08:53:43', NULL);

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '角色名称',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '角色编码',
  `permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '0：全部，1：自定义，2：本级级子级，3：本级',
  `sort` int NULL DEFAULT NULL COMMENT '排序',
  `is_del` int NULL DEFAULT 0 COMMENT '是否删除：0未删除，1已删除',
  `creator` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES ('441b6dae329b3a20ad8b4f4ca8f83a0b', '普通用户', '1020cb789f', '2', 0, 0, '534a37c366ec47878a6b0c85703d0bc2', '2023-04-12 14:29:16', '2023-04-12 14:29:16', '');
INSERT INTO `sys_role` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '管理员', 'SR000001', '0', 0, 0, NULL, '2023-04-12 14:27:40', '2023-03-29 08:51:39', '管理员');

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu`  (
  `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色id',
  `menu_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单id',
  PRIMARY KEY (`role_id`, `menu_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '06936eec3258c1fa675c8b6b697160f5');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '07e1aebb5b69b55b7eb0ce79fed00f40');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '0a59255aac53f421613c4d8516fcc305');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '0e769d6164cff598ae7215c99849bd1c');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '11107c717306bd0d9e993cf32a94974e');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '120d967459a9e7323692b3fa49c1ba59');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '1cda1e6f35077cb1f89007fa36343a3d');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '1ec1c1cb127d83f6346904220b3ed20b');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '223588533ceb03066c89940863dc747e');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '3afbad18e475a7f7a4aeec6ab6e6c0fc');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '44979f524b88ed2dfbf14e4267ebd045');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '5de088a93f0828a57e4c70959831458b');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '5df7c65d51129baefee123ef3bc2d7de');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '5e67672047d0a00bf861ba2255535238');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '628431d108e3530ac37dfa2180dff376');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '7b02ec134bcd2a74b7930ce03da4b8bb');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '850a1c29af28318e6e470a14aaeb50e5');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '9658b61b187ae33b7c8c39fc8c1265dc');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', '9a36ed1841e3e6d2da32df17980edaa2');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a002');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a003');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a004');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a005');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a006');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a007');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a008');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a009');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a010');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b1851d1b13594e71840103c11a37a011');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b25838d6e06c6cdad82c1ad9b1096f26');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b4cfa05bff2269fee06788b32115851a');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b8db9ff560e383e59d604e19c9fbd3cb');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'b9401c42bc1e58e0a48e6b3308cff617');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'ea83fb03d2117cb287973d6889984686');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'ed9b00353e7f4cf6c446b2d631db8029');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f3138bd5b256d82f9eebe07c6679cf15');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f8b972bc005a9c6691a43b76839b0666');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f8b972bc005a9c6691a43b76839b0667');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f8b972bc005a9c6691a43b76839b0668');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f8b972bc005a9c6691a43b76839b0669');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f8b972bc005a9c6691a43b76839b0670');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f8b972bc005a9c6691a43b76839b0671');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'f8b972bc005a9c6691a43b76839b0675');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'fb9f883cfbacefcaf0805eeea895fd32');
INSERT INTO `sys_role_menu` VALUES ('534a37c366ec47878a6b0c85703d0bc3', 'fdaf429afb33d54beeee7eaea93e5e96');

-- ----------------------------
-- Table structure for sys_role_org
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_org`;
CREATE TABLE `sys_role_org`  (
  `org_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '组织机构id',
  `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色id',
  PRIMARY KEY (`org_id`, `role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户组织机构关联表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_role_org
-- ----------------------------
INSERT INTO `sys_role_org` VALUES ('534a37c366ec47878a6b0c85703d0bc4', '534a37c366ec47878a6b0c85703d0bc3');

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user`  (
  `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '主键',
  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '登录名',
  `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名/昵称',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '密码',
  `type` int NULL DEFAULT NULL COMMENT '用户类型：1、管理员，2、普通用户',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '头像',
  `gender` int NULL DEFAULT NULL COMMENT '性别：0、男，1、女',
  `birthday` date NULL DEFAULT NULL COMMENT '出生日期',
  `is_login` int NULL DEFAULT 0 COMMENT '禁止登录：0未禁用，1已禁用',
  `is_del` int NULL DEFAULT 0 COMMENT '删除标识：0未删除，1已删除',
  `open_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '唯一标识',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '地址',
  `id_card` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '身份证号码',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邮箱',
  `create_by` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`, `username`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES ('1', 'admin', '管理员', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 1, NULL, NULL, 0, '2023-03-29', 0, 0, '', '', '', '', NULL, '2023-04-14 15:48:44', '2023-03-29 08:49:27', NULL);
INSERT INTO `sys_user` VALUES ('3ad1bd6b76c2e5573ea1805b7d68c6a9', 'system', '管理者', '240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9', 2, '18810011002', '', 0, '2023-04-03', 0, 0, NULL, '甘肃兰州', NULL, 'system@qq.com', NULL, '2023-07-07 11:08:29', '2023-04-13 14:41:21', '普通管理者');

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role`  (
  `user_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户id',
  `role_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色id',
  PRIMARY KEY (`user_id`, `role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户角色' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES ('1', '534a37c366ec47878a6b0c85703d0bc3');
INSERT INTO `sys_user_role` VALUES ('3ad1bd6b76c2e5573ea1805b7d68c6a9', '441b6dae329b3a20ad8b4f4ca8f83a0b');

SET FOREIGN_KEY_CHECKS = 1;
