/*
 Navicat Premium Dump SQL

 Source Server         : MySQL
 Source Server Type    : MySQL
 Source Server Version : 80041 (8.0.41)
 Source Host           : localhost:3306
 Source Schema         : tansci_boot

 Target Server Type    : MySQL
 Target Server Version : 80041 (8.0.41)
 File Encoding         : 65001

 Date: 31/03/2025 17:55:23
*/

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、禁用',
  `classify` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分类编码',
  `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, '56d41ddc-f09e-11ee-a7f7-e0be038740d4', '534a37c366ec47878a6b0c85703d0bc2', '2024-04-02 11:31:29', '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, '56d41ddc-f09e-11ee-a7f7-e0be038740d4', NULL, '2024-04-02 11:32:10', '2023-05-11 10:58:43', '轮播图测试');
INSERT INTO `lc_pages` VALUES ('ce620f517565f989d718385d4e4033ac', 'aaaa', '啊啊', NULL, NULL, NULL, 'ce620f517565f989d718385d4e4033ac', '534a37c366ec47878a6b0c85703d0bc2', '2024-04-02 11:31:50', '2023-05-12 08:55:56', 'aaaa');

-- ----------------------------
-- Table structure for lc_pages_classify
-- ----------------------------
DROP TABLE IF EXISTS `lc_pages_classify`;
CREATE TABLE `lc_pages_classify`  (
  `id` varchar(64) 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 '名称',
  `parent_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '父页面',
  `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_classify
-- ----------------------------
INSERT INTO `lc_pages_classify` VALUES ('306eeeb4daa0674cbf4026f6910ba5a0', '根节点', '0', NULL, '2024-04-02 11:05:58', '2023-05-11 11:24:39', '支持增删改查、分页、筛选的表格例子');
INSERT INTO `lc_pages_classify` VALUES ('56d41ddc-f09e-11ee-a7f7-e0be038740d4', '已绑定', '306eeeb4daa0674cbf4026f6910ba5a0', NULL, '2024-04-02 11:08:54', '2024-04-02 11:08:54', '');
INSERT INTO `lc_pages_classify` VALUES ('ce620f517565f989d718385d4e4033ac', '未绑定', '306eeeb4daa0674cbf4026f6910ba5a0', NULL, '2024-04-02 11:08:44', '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\" : \"3766b233e65047908e6ade58f6a91cef\",\r\n  \"name\" : \"接口生成\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"fc09d5b985f44120956d5d4f9fbd3658\",\r\n  \"path\" : \"generator\",\r\n  \"createTime\" : 1706837176932,\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\" : \"72d2a17d7417416ab095d82cfb5114cd\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"3766b233e65047908e6ade58f6a91cef\",\r\n  \"name\" : \"分页\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1706843973047,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"page\",\r\n  \"method\" : \"GET\",\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\nreturn db.page(\"\"\"\r\n    select * from sys_gen \r\n    where 1=1\r\n    ?{tableName, and table_name like concat(\'%\',#{tableName},\'%\')}\r\n    ?{tableComment, and table_comment like concat(\'%\',#{tableComment},\'%\')}\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\" : \"836d46dce24045c78408f44db6dfda7d\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"3766b233e65047908e6ade58f6a91cef\",\r\n  \"name\" : \"删除接口\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1706843980275,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"delete/{id}\",\r\n  \"method\" : \"DELETE\",\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 org.ssssssss.magicapi.core.service.MagicResourceService\r\n\r\nvar interfaceId = db.selectValue(\"\"\"select interface_id from sys_gen where id = #{id}\"\"\")\r\nif(interfaceId != null){\r\n    MagicResourceService.delete(interfaceId)\r\n}\r\n\r\nreturn db.table(\"sys_gen\").where().eq(\"id\",id).delete()');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/接口生成/接口生成.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"470d902b51e5466d899789de871a426f\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"3766b233e65047908e6ade58f6a91cef\",\r\n  \"name\" : \"接口生成\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1711505784847,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"execute\",\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\nimport org.ssssssss.magicapi.core.model.Option;\r\nimport org.ssssssss.magicapi.core.model.ApiInfo;\r\nimport org.ssssssss.magicapi.core.model.Group;\r\nimport org.ssssssss.magicapi.core.service.MagicResourceService;\r\nimport log;\r\n\r\ninfo = info::json\r\nvar permissionPrefix = (info.modulePath + info.businessPath).replace(/^\\//,\'\').replace(/\\/\\//, \'/\').replace(\'/\', \':\')\r\n\r\n//创建组\r\nvar getGroup = (type) => {\r\n    var moduleGroup = MagicResourceService.tree(type).children.filter(it => {\r\n        return it.node.path == info.modulePath || it.node.path == info.modulePath.substring(1, info.modulePath.length())\r\n    })\r\n    if(moduleGroup.length == 0){\r\n        Group group = new Group();\r\n        group.setId(UUID.randomUUID().toString().replace(\'-\', \'\'));\r\n        group.setName(info.moduleName);\r\n        group.setPath(info.modulePath);\r\n        group.setParentId(\"0\");\r\n        group.setType(type)\r\n        MagicResourceService.saveGroup(group);\r\n        moduleGroup = group;\r\n    }else{\r\n        moduleGroup = moduleGroup[0].node\r\n    }\r\n    //创建功能组\r\n    var businessGroup = MagicResourceService.tree(type).children.filter(it => it.node.id == moduleGroup.id)[0].children.filter(it => {\r\n        return it.node.path == info.businessPath || it.node.path == info.businessPath.substring(1, info.businessPath.length())\r\n    })\r\n    if(businessGroup.length == 0){\r\n        Group group = new Group();\r\n        group.setId(UUID.randomUUID().toString().replace(\'-\', \'\'));\r\n        group.setName(info.businessName);\r\n        group.setPath(info.businessPath);\r\n        group.setParentId(moduleGroup.getId());\r\n        group.setType(type)\r\n        MagicResourceService.saveGroup(group);\r\n        businessGroup = group;\r\n    }else{\r\n        businessGroup = businessGroup[0].node\r\n    }\r\n\r\n    // 子表组\r\n    var subPath = \"/sub\"\r\n    var bGroup = MagicResourceService.tree(type).children.filter(it => it.node.id == moduleGroup.id)[0]\r\n    var subGroup = bGroup.children.filter(it => it.node.id == businessGroup.id )[0].children.filter(it =>{\r\n        return it.node.path == subPath || it.node.path == subPath.substring(1, subPath.length())\r\n    })\r\n    if(info.template == \"subTable\"){\r\n        if(subGroup.length == 0){\r\n            Group group = new Group();\r\n            group.setId(UUID.randomUUID().toString().replace(\'-\', \'\'));\r\n            group.setName(\"子表\");\r\n            group.setPath(\"/sub\");\r\n            group.setParentId(businessGroup.getId());\r\n            group.setType(type)\r\n            MagicResourceService.saveGroup(group);\r\n            subGroup = group;  \r\n        }else{\r\n            subGroup = subGroup[0].node\r\n        }\r\n    }\r\n\r\n    return {\r\n        moduleGroup,\r\n        businessGroup,\r\n        subGroup\r\n    }\r\n}\r\n//删除临时文件\r\nvar deleteFiles = (groupId, paths) => {\r\n    var listFiles = MagicResourceService.listFiles(groupId)\r\n    listFiles.forEach(it => {\r\n        if(paths.indexOf(it.path) != -1){\r\n            MagicResourceService.delete(it.id)\r\n        }\r\n    })\r\n}\r\n\r\nvar businessGroup = getGroup(\'api\').businessGroup\r\n//删除api接口\r\ndeleteFiles(businessGroup.getId(),[\'/list\', \'/save\', \'/get\', \'/delete\'])\r\n\r\ncolumns = columns::json\r\nvar listFields = columns.filter(it => it.list).map(it => it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()).join(\',\')\r\nvar wheres = \'\';\r\ncolumns.forEach(it => {\r\n    var field = it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n    if(it.query){\r\n        if(it.where == \'in\'){\r\n            wheres += `    ?{${it.columnName}, and ${field} in(#{`+it.columnName+`.split(\',\')}) }\\n`\r\n        }else if(it.where == \'like\'){\r\n            wheres += `    ?{${it.columnName}, and ${field} like concat(\'%\',#{${it.columnName}},\'%\') }\\n`\r\n        }else{\r\n            wheres += `    ?{${it.columnName}, and ${field} ${it.where} #{${it.columnName}} }\\n`\r\n        }\r\n    }\r\n})\r\n//取得数据库的表信息\r\ndatasource = datasource || \'\'\r\nvar commonField = db[datasource].select(\"\"\"\r\n    SELECT\r\n        column_name\r\n    FROM\r\n        information_schema.COLUMNS\r\n    WHERE\r\n        table_name = #{tableName} AND column_name IN ( \'is_del\', \'create_by\', \'create_date\', \'update_by\', \'update_date\' ) AND table_schema = DATABASE()\r\n\"\"\")\r\ncommonField = commonField.map(it => it.columnName)\r\nvar primary = db[datasource].selectValue(\"SELECT column_name FROM information_schema.COLUMNS WHERE table_name = #{tableName} and column_key = \'PRI\' and table_schema = database() limit 1\")\r\nvar primaryLowerCamelCase = primary.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n\r\nvar logic = \'\'\r\nif(commonField.contains(\'is_del\')){\r\n    logic = \'.logic()\'\r\n    wheres += `    and is_del = 0\\n`\r\n}\r\nwheres = wheres.substring(0,wheres.length() - 1)\r\n\r\nvar datasourceScript = datasource ? `.${datasource}` : \'\';\r\n\r\n// 产生查询api接口\r\nApiInfo listApi = new ApiInfo()\r\nlistApi.setName(\"列表\")\r\nlistApi.setPath(\"/list\")\r\nlistApi.setMethod(\"GET\")\r\nlistApi.setGroupId(businessGroup.getId())\r\nlistApi.setScript(`return db${datasourceScript}.page(\"\"\"\r\nselect ${primary},${listFields} from ${tableName} where 1=1\r\n${wheres}\r\n\"\"\")`)\r\n// listApi.setOption([new Option(\'permission\', `${permissionPrefix}:view`, \'允许拥有该权限的访问\')])\r\nMagicResourceService.saveFile(listApi)\r\n\r\nvar saveMethod = \'save(data)\'\r\nif(commonField.size() >= 4){\r\n    saveMethod = \'saveOrUpdate(data)\'\r\n}\r\n\r\n//产生增册改查api接口\r\nvar insertFields = \'\';\r\ncolumns.forEach(it => {\r\n    var field = it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n    insertFields += `, #{body.`+it.columnName+`}`\r\n})\r\n\r\nApiInfo saveApi = new ApiInfo()\r\nsaveApi.setName(\"保存\")\r\nsaveApi.setPath(\"/save\")\r\nsaveApi.setMethod(\"POST\")\r\nsaveApi.setGroupId(businessGroup.getId())\r\nsaveApi.setScript(`return db.insert(\"\"\"insert into ${tableName}(${primary},${listFields}) values (uuid() ${insertFields})\"\"\")`)\r\n// saveApi.setOption([new Option(\'wrap_request_parameter\', \'data\'), new Option(\'permission\', `${permissionPrefix}:save`, \'允许拥有该权限的访问\')])\r\nMagicResourceService.saveFile(saveApi)\r\n\r\n// 修改\r\nvar updateFields = \'\';\r\ncolumns.forEach(it => {\r\n    var field = it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n    updateFields += `?{body.${it.columnName}, ,${field} = #{body.${it.columnName}}}\\n`\r\n})\r\nApiInfo updateApi = new ApiInfo()\r\nupdateApi.setName(\"修改\")\r\nupdateApi.setPath(\"/update\")\r\nupdateApi.setMethod(\"POST\")\r\nupdateApi.setGroupId(businessGroup.getId())\r\nupdateApi.setScript(`return db.update(\"\"\"update ${tableName} set \\n${primary} = #{body.${primary}}\\n ${updateFields} where ${primary} = #{body.${primary}}\"\"\")`)\r\n// updateApi.setOption([new Option(\'wrap_request_parameter\', \'data\'), new Option(\'permission\', `${permissionPrefix}:save`, \'允许拥有该权限的访问\')])\r\nMagicResourceService.saveFile(updateApi)\r\n\r\nApiInfo deleteApi = new ApiInfo()\r\ndeleteApi.setName(\"删除\")\r\ndeleteApi.setPath(\"/delete\")\r\ndeleteApi.setMethod(\"DELETE\")\r\ndeleteApi.setGroupId(businessGroup.getId())\r\ndeleteApi.setScript(`return db${datasourceScript}.table(\'${tableName}\')${logic}.where().eq(\'${primary}\', ${primaryLowerCamelCase}).delete()`)\r\n// deleteApi.setOption([new Option(\'permission\', `${permissionPrefix}:delete`, \'允许拥有该权限的访问\')])\r\nMagicResourceService.saveFile(deleteApi)\r\n\r\nvar saveFields = columns.filter(it => it.save).map(it => it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()).join(\',\')\r\n//产生单个行Api接口\r\nApiInfo getApi = new ApiInfo()\r\ngetApi.setName(\"详情\")\r\ngetApi.setPath(\"/get\")\r\ngetApi.setMethod(\"GET\")\r\ngetApi.setGroupId(businessGroup.getId())\r\ngetApi.setScript(`return db${datasourceScript}.selectOne(\"\"\"select ${saveFields} from ${tableName} where ${primary} = #{${primaryLowerCamelCase}}\"\"\")`)\r\n// getApi.setOption([new Option(\'permission\', `${permissionPrefix}:view`, \'允许拥有该权限的访问\')])\r\nMagicResourceService.saveFile(getApi)\r\n\r\n// 树列表接口\r\nif(info.template == \"tree\"){\r\n    ApiInfo treeApi = new ApiInfo()\r\n    treeApi.setName(\"树列表\")\r\n    treeApi.setPath(\"/tree\")\r\n    treeApi.setMethod(\"GET\")\r\n    treeApi.setGroupId(businessGroup.getId())\r\n    treeApi.setScript(`var toTree = (list,${info.treePid}) => select t.*,toTree(list,t.${info.treeId}) children from list t where t.${info.treePid} = ${info.treePid}\r\n        var list = toTree(db.select(\'select ${listFields} from ${datasourceScript?datasourceScript+\'.\':\'\'}${tableName}\'),\'0\')\r\n        return {\r\n            list: list,\r\n            total: list.getLength()\r\n        }\r\n    `)\r\n    // treeApi.setOption([new Option(\'permission\', `${permissionPrefix}:view`, \'允许拥有该权限的访问\')])\r\n    MagicResourceService.saveFile(treeApi)\r\n}\r\n\r\n// 主子表 api接口\r\nif(info.template == \"subTable\"){\r\n    var subGroup = getGroup(\'api\').subGroup\r\n    subColumns = subColumns::json\r\n    var subListFields = subColumns.filter(it => it.list).map(it => it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()).join(\',\')\r\n    var subWheres = \'\';\r\n    subColumns.forEach(it => {\r\n        var field = it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n        if(it.query){\r\n            if(it.where == \'in\'){\r\n                subWheres += `?{${it.columnName}, and ${field} in(#{`+it.columnName+`.split(\',\')}) }\\n`\r\n            }else if(it.where == \'like\'){\r\n                subWheres += `?{${it.columnName}, and ${field} like concat(\'%\',#{${it.columnName}},\'%\') }\\n`\r\n            }else{\r\n                subWheres += `?{${it.columnName}, and ${field} ${it.where} #{${it.columnName}} }\\n`\r\n            }\r\n        }\r\n    })\r\n    var subPrimary = db[datasource].selectValue(\"SELECT column_name FROM information_schema.COLUMNS WHERE table_name = #{subTableName} and column_key = \'PRI\' and table_schema = database() limit 1\")\r\n    var subPrimaryLowerCamelCase = subPrimary.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n    var subLogic = \'\'\r\n    if(subListFields.contains(\'is_del\')){\r\n        subLogic = \'.logic()\'\r\n        subWheres += `    and is_del = 0\\n`\r\n    }\r\n    subWheres = subWheres.substring(0,subWheres.length() - 1)\r\n    \r\n    // 列表\r\n    ApiInfo subListApi = new ApiInfo()\r\n    subListApi.setName(\"列表\")\r\n    subListApi.setPath(\"/list\")\r\n    subListApi.setMethod(\"GET\")\r\n    subListApi.setGroupId(subGroup.getId())\r\n    subListApi.setScript(`return db${datasourceScript}.page(\"\"\"\r\n        select ${subListFields} from ${subTableName} where 1=1\r\n    ${subWheres}\r\n    \"\"\")`)\r\n    // subListApi.setOption([new Option(\'permission\', `${permissionPrefix}:view`, \'允许拥有该权限的访问\')])\r\n    MagicResourceService.saveFile(subListApi)\r\n\r\n    // 保存\r\n    var insertSubFields = \'\';\r\n    subColumns.forEach(it => {\r\n        var field = it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n        insertSubFields += `, #{body.`+it.columnName+`}`\r\n    })\r\n    ApiInfo subSaveApi = new ApiInfo()\r\n    subSaveApi.setName(\"保存\")\r\n    subSaveApi.setPath(\"/save\")\r\n    subSaveApi.setMethod(\"POST\")\r\n    subSaveApi.setGroupId(subGroup.getId())\r\n    subSaveApi.setScript(`return db.insert(\"\"\"insert into ${subTableName}(${subPrimary},${subListFields}) values (uuid() ${insertSubFields})\"\"\")`)\r\n    // subSaveApi.setOption([new Option(\'wrap_request_parameter\', \'data\'), new Option(\'permission\', `${permissionPrefix}:save`, \'允许拥有该权限的访问\')])\r\n    MagicResourceService.saveFile(subSaveApi)\r\n\r\n    // 修改\r\n    var updateSubFields = \'\';\r\n    subColumns.forEach(it => {\r\n        var field = it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()\r\n        updateSubFields += `?{body.${it.columnName}, ,${field} = #{body.${it.columnName}}}\\n`\r\n    })\r\n    ApiInfo subUpdateApi = new ApiInfo()\r\n    subUpdateApi.setName(\"修改\")\r\n    subUpdateApi.setPath(\"/update\")\r\n    subUpdateApi.setMethod(\"POST\")\r\n    subUpdateApi.setGroupId(subGroup.getId())\r\n    subUpdateApi.setScript(`return db.update(\"\"\"update ${subTableName} set \\n${subPrimary} = #{body.${subPrimary}}\\n ${updateSubFields} where ${subPrimary} = #{body.${subPrimary}}\"\"\")`)\r\n    // subUpdateApi.setOption([new Option(\'wrap_request_parameter\', \'data\'), new Option(\'permission\', `${permissionPrefix}:save`, \'允许拥有该权限的访问\')])\r\n    MagicResourceService.saveFile(subUpdateApi)\r\n\r\n    // 删除\r\n    ApiInfo subDeleteApi = new ApiInfo()\r\n    subDeleteApi.setName(\"删除\")\r\n    subDeleteApi.setPath(\"/delete\")\r\n    subDeleteApi.setMethod(\"DELETE\")\r\n    subDeleteApi.setGroupId(subGroup.getId())\r\n    subDeleteApi.setScript(`return db${datasourceScript}.table(\'${subTableName}\')${subLogic}.where().eq(\'${subPrimary}\', ${subPrimaryLowerCamelCase}).delete()`)\r\n    // subDeleteApi.setOption([new Option(\'permission\', `${permissionPrefix}:delete`, \'允许拥有该权限的访问\')])\r\n    MagicResourceService.saveFile(subDeleteApi)\r\n\r\n    var subSaveFields = subColumns.filter(it => it.save).map(it => it.columnName.replace(/([A-Z])/g,\"_$1\").toLowerCase()).join(\',\')\r\n    // 详情\r\n    ApiInfo subGetApi = new ApiInfo()\r\n    subGetApi.setName(\"详情\")\r\n    subGetApi.setPath(\"/get\")\r\n    subGetApi.setMethod(\"GET\")\r\n    subGetApi.setGroupId(subGroup.getId())\r\n    subGetApi.setScript(`return db${datasourceScript}.selectOne(\"\"\"select ${subPrimary},${subSaveFields} from ${subTableName} where ${subPrimary} = #{${subPrimaryLowerCamelCase}}\"\"\")`)\r\n    // subGetApi.setOption([new Option(\'permission\', `${permissionPrefix}:view`, \'允许拥有该权限的访问\')])\r\n    MagicResourceService.saveFile(subGetApi)\r\n}\r\n\r\nvar moduleGroup = getGroup(\'api\').moduleGroup\r\nreturn moduleGroup.id\r\n');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/接口生成/新增接口.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"0631fbe5d71c4a6990dc45bbcadd35e5\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"3766b233e65047908e6ade58f6a91cef\",\r\n  \"name\" : \"新增接口\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1706848294180,\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\nreturn db.insert(\"\"\"\r\n    INSERT INTO `sys_gen` (`id`, `interface_id`,`data_source`, `table_name`, `table_comment`, `columns`, `sub_table_name`, `sub_table_comment`, `sub_columns`, `info`, `update_time`, `create_time`) \r\n    VALUES (uuid(),#{interfaceId},#{dataSource},#{tableName},#{tableComment},#{columns},#{subTableName},#{sub_tableComment},#{subColumns},#{info},now(),now())\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/接口生成/根据表查列.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"8a8899e6a39e442ca51d08db50067cc0\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"3766b233e65047908e6ade58f6a91cef\",\r\n  \"name\" : \"根据表查列\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1706848387714,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"columns\",\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 column_name,column_comment,column_type,case when is_nullable = \'YES\' then 0 else 1 end required\r\n    FROM information_schema.COLUMNS \r\n    WHERE table_name = #{name}\r\n    AND column_name != \'id\'\r\n    AND table_schema = DATABASE()\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/接口生成/表列表.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"2274d01e99954f35bacde40c983db2f8\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"3766b233e65047908e6ade58f6a91cef\",\r\n  \"name\" : \"表列表\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1706843981698,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"tables\",\r\n  \"method\" : \"GET\",\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\nreturn db.select(\"\"\"\r\n    select table_schema,table_name,table_comment \r\n    from information_schema.tables \r\n    where table_schema = #{name}\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\" : null,\r\n  \"updateTime\" : 1712020971583,\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\nreturn db.insert(\"\"\"\r\n    INSERT INTO lc_pages(`id`, `title`, `subtitle`, `parent_id`, `pageschema`, `status`, `creator_id`, `classify`, `update_time`, `create_time`, `remarks`) \r\n    VALUES \r\n    (uuid(), #{body.title},#{body.subtitle},#{body.parentId},#{body.pageschema},0,#{body.creatorId},#{body.classify},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\" : null,\r\n  \"updateTime\" : 1712021004644,\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 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.classify, ,`classify` = #{body.classify}}\r\n    ?{body.remarks, ,`remarks` = #{body.remarks}}\r\n    where id = #{body.id}\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\" : \"2125a0c95fd0461bb41723c516b4d229\",\r\n  \"name\" : \"分类管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"469af969df9e4fe4bf2c70a9608a517e\",\r\n  \"path\" : \"classify\",\r\n  \"createTime\" : 1712020553642,\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\" : \"c673f0c0287142148d6783ab416a2a76\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"2125a0c95fd0461bb41723c516b4d229\",\r\n  \"name\" : \"保存\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1712020875321,\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\nreturn db.insert(\"\"\"\r\n    INSERT INTO `lc_pages_classify` (`id`, `parent_id`, `name`,`creator_id`,`update_time`, `create_time`,`remarks`) \r\n    values (uuid(),#{body.parentId},#{body.name},#{body.creatorId},now(), now(),#{body.remarks})\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/应用管理/页面管理/分类管理/修改.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"ad0191d21c834a068f9c601c74f13d9b\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"2125a0c95fd0461bb41723c516b4d229\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1712027156763,\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 lc_pages_classify set \r\n    update_time = now() \r\n    ?{body.parentId, ,`parent_id` = #{body.parentId}}\r\n    ?{body.name, ,`name` = #{body.name}}\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\" : \"6d63eb2030ca456fa3aba1d976c4986a\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"2125a0c95fd0461bb41723c516b4d229\",\r\n  \"name\" : \"列表\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1712022873564,\r\n  \"lock\" : \"0\",\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\nvar list = db.select(\"\"\"\r\n    select * \r\n    from lc_pages_classify\r\n    where 1 = 1\r\n    ?{name, and name = #{name}}\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\" : \"cf71ab8e4ff848e7aefa1c6eb4644e02\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"2125a0c95fd0461bb41723c516b4d229\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1712026703236,\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\nreturn db.transaction(()=>{\r\n    var row = db.table(\"lc_pages_classify\").where().eq(\"id\", id).delete();\r\n    if(row){\r\n        // 删除子集\r\n        db.table(\"lc_pages_classify\").where().eq(\"parent_id\", id).delete();\r\n    }\r\n    return row;\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\" : null,\r\n  \"updateTime\" : 1712020970046,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\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    ?{classify, and classify = #{classify}}\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\" : 1708933795963,\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\nimport log;\r\n\r\nvar tokens = StpUtil.searchTokenValue(\"\", 0, -1, true).map(item => {return item.substring(item.lastIndexOf(\':\')+1,item.length())});\r\nlog.info(\"{}\",tokens)\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 = [REDACTED]    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\" : 1708928493064,\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\n// 纯数字\r\nimport cn.hutool.captcha.CaptchaUtil;\r\nimport cn.hutool.captcha.LineCaptcha;\r\nimport cn.hutool.captcha.generator.RandomGenerator;\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\nlineCaptcha.setGenerator(new RandomGenerator(\"0123456789\", 4));\r\nCodeCacheMap.put(lineCaptcha.getCode(),lineCaptcha.getCode())\r\n\r\nOutputStream bOut = new ByteArrayOutputStream();\r\nlineCaptcha.write(bOut)\r\nreturn bOut.toByteArray()\r\n\r\n// 数字字母组合\r\n// import cn.hutool.captcha.CaptchaUtil;\r\n// import cn.hutool.captcha.LineCaptcha;\r\n// import java.io.ByteArrayOutputStream;\r\n// import java.io.OutputStream;\r\n// import com.tansci.model.CodeCacheMap;\r\n\r\n// var lineCaptcha = CaptchaUtil.createLineCaptcha(100, 60);\r\n// CodeCacheMap.put(lineCaptcha.getCode(),lineCaptcha.getCode())\r\n\r\n// OutputStream bOut = new ByteArrayOutputStream();\r\n// lineCaptcha.write(bOut)\r\n// return 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\" : \"b8fda8d83a3449cbacc8a1ee5e040ab8\",\r\n  \"name\" : \"工作流\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"acff5ad7aae64de2acb03e1d16a58ce2\",\r\n  \"path\" : \"work\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1742909385448,\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\" : \"5ec3f09f11014fb3b108c89b6885218a\",\r\n  \"name\" : \"模型管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"b8fda8d83a3449cbacc8a1ee5e040ab8\",\r\n  \"path\" : \"model\",\r\n  \"createTime\" : 1742909403621,\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\" : \"626ccce183a14523b50b363df2c8816b\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5ec3f09f11014fb3b108c89b6885218a\",\r\n  \"name\" : \"修改\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743343719448,\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 flow_model set \r\n    update_time = now()\r\n    ?{body.code, ,`code` = #{body.code}}\r\n    ?{body.name, ,`name` = #{body.name}}\r\n    ?{body.content, ,`content` = #{body.content}}\r\n    ?{body.taskId, ,`task_id` = #{body.taskId}}\r\n    ?{body.status, ,`status` = #{body.status}}\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\" : \"2b5be8ee089a4f9f83c0faa1879232cf\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5ec3f09f11014fb3b108c89b6885218a\",\r\n  \"name\" : \"分页\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1742909452825,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\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 flow_model\r\n    where 1 = 1\r\n    ?{status != null , and status = #{status}}\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\" : \"53fb519a3be9489989975af84b8878d5\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5ec3f09f11014fb3b108c89b6885218a\",\r\n  \"name\" : \"删除\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1742909454687,\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\nreturn db.table(\"flow_model\").where().eq(\"id\", id).delete()');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/模型管理/新增.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"04e32ed909d44e0dadd93e51c6c22cfb\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5ec3f09f11014fb3b108c89b6885218a\",\r\n  \"name\" : \"新增\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1742910195992,\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\nimport \'cn.dev33.satoken.stp.StpUtil\';\r\n\r\nvar userId = StpUtil.getLoginId()\r\nreturn db.insert(\"\"\"\r\n    INSERT INTO flow_model(`id`, `code`, `name`, `content`, `status`, `create_by`, `update_time`, `create_time`, `remarks`) \r\n    VALUES (uuid(),#{body.code},#{body.name},#{body.content},0,#{userId},now(),now(),#{body.remarks})\r\n\"\"\")');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/模型管理/详情.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"ff40df477ac44402a079de10e9b8ef3d\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5ec3f09f11014fb3b108c89b6885218a\",\r\n  \"name\" : \"详情\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1742909456419,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"details\",\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.selectOne(\"\"\"\r\n    select * from flow_model where id = #{id}\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\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"流程管理\",\r\n  \"type\" : \"api\",\r\n  \"parentId\" : \"b8fda8d83a3449cbacc8a1ee5e040ab8\",\r\n  \"path\" : \"workflow\",\r\n  \"createTime\" : 1742910704023,\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\" : \"copy1743346708057d27976\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"任务列表\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346785768,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"taskList\",\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 com.tansci.service.FlowableService as flowableService;\r\n\r\nreturn flowableService.taskList();');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/任务审批通过.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1742910941772d263\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"任务审批通过\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1742910991392,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"approveTask\",\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\nimport com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!body.taskId){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.approveTask(\r\n    body.taskId::string\r\n);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/任务被拒绝.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1742910967305d92063\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"任务被拒绝\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1742910989741,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"rejectTask\",\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\nimport com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!body.taskId){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.rejectTask(\r\n    body.taskId::string\r\n);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/删除正在运行的流程.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1743346641682d80629\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"删除正在运行的流程\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346772692,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"deleteProcessInstance\",\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 com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!val1 || !val2){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.deleteProcessInstance(\r\n    val1::string,\r\n    val2::string,\r\n);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/删除流程.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1743346606264d56690\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"删除流程\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346770977,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"deleteDeployment\",\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 com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!id){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.deleteDeployment(\r\n    id::string\r\n);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/启动流程.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1742910840666d8340\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"启动流程\",\r\n  \"createTime\" : 1742910876719,\r\n  \"updateTime\" : 1742910994718,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"startProcessInstance\",\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\nimport com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!body.processId){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.startProcessInstance(\r\n    body.processId::string\r\n);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/挂起流程.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1743346586145d31739\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"挂起流程\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346769430,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"suspendProcess\",\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 com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!id){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.suspendProcess(\r\n    id::string\r\n);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/模型列表.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1742910883850d24391\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"模型列表\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346762163,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"modelList\",\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 com.tansci.service.FlowableService as flowableService;\r\n\r\nreturn flowableService.modelList();');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/流程定义.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"copy1743346466922d96978\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"流程定义\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346767414,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"processDefinitionList\",\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 com.tansci.service.FlowableService as flowableService;\r\n\r\nreturn flowableService.processDefinitionList();');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/激活流程.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"f4adebe0f19e4c2a8e5af39f890bf974\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"激活流程\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346765823,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"activateProcess\",\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 com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!id){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.activateProcess(\r\n    id::string\r\n);');
INSERT INTO `magic_api_file` VALUES ('/tansci-api/api/系统管理/工作流/流程管理/部署流程.ms', '{\r\n  \"properties\" : { },\r\n  \"id\" : \"576744c3f8994ca9a761fa7b608be940\",\r\n  \"script\" : null,\r\n  \"groupId\" : \"5d2432706bca4d168ddd547cd5681807\",\r\n  \"name\" : \"部署流程\",\r\n  \"createTime\" : null,\r\n  \"updateTime\" : 1743346514657,\r\n  \"lock\" : \"0\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\r\n  \"path\" : \"deployProcess\",\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\nimport com.tansci.service.FlowableService as flowableService;\r\n\r\nif(!body.name || !body.xml){\r\n    exit 500, \'请求参数有误！\';\r\n}\r\n\r\nreturn flowableService.deployProcess(\r\n    body.name::string,\r\n    body.xml::string\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\" : \"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\" : 1708659604274,\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\nimport com.tansci.utils.Sha256Util;\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 password = [REDACTED] 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\" : null,\r\n  \"updateTime\" : 1742627057580,\r\n  \"lock\" : \"1\",\r\n  \"createBy\" : null,\r\n  \"updateBy\" : null,\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    ?{nickname , and nickname like concat(\'%\',#{nickname},\'%\')}\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\" : null,\r\n  \"updateTime\" : 1708928338654,\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_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 != null, ,`sort` = #{body.sort}}\r\n    ?{body.component, ,`component` = #{body.component}}\r\n    ?{body.componentType != null, ,`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` ASC) 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 ('bf5d5e35-0d72-11f0-8434-4ccc6a2e3718', '0', 'model_status', 1, -1, '流程模型状态', 0, NULL, NULL, NULL, '2025-03-30 22:24:53', '2025-03-30 22:24:53', '流程模型状态');
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 ('ca22496d-0d72-11f0-8434-4ccc6a2e3718', 'bf5d5e35-0d72-11f0-8434-4ccc6a2e3718', 'model_status', 1, 0, '未部署', 0, NULL, NULL, NULL, '2025-03-30 22:25:11', '2025-03-30 22:25:11', '');
INSERT INTO `sys_dict` VALUES ('d3a9d955-0d72-11f0-8434-4ccc6a2e3718', 'bf5d5e35-0d72-11f0-8434-4ccc6a2e3718', 'model_status', 1, 1, '已部署', 1, NULL, NULL, NULL, '2025-03-30 22:25:27', '2025-03-30 22:25:27', '');
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 '接口编码',
  `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
-- ----------------------------

-- ----------------------------
-- 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
-- ----------------------------
INSERT INTO `sys_login_log` VALUES ('ea9cdd9a-0e15-11f0-9a52-4ccc6a2e3718', 'admin', NULL, '成功', 'Chrome', 'Windows 10 or Windows Server 2016', '内网IP', '127.0.0.1', 'fa0ad9d5-0501-4f59-b75f-3837a4764bff', '成功', '2025-03-31 17:52:54');

-- ----------------------------
-- 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 ('02470e78-c178-11ee-a758-e0be038740d4', 'b25838d6e06c6cdad82c1ad9b1096f26', 'codeGen', '/lowcode/CodeGen', 'FolderRemove', '接口生成', 'APIGeneration', NULL, 2, NULL, 0, 0, 0, 1, 1, '2024-02-02 11:06:07', '2024-02-02 11:06:07', '');
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, 4, NULL, 0, 0, 0, 1, 1, '2025-03-22 10:21:17', '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 ('2a3d3641-c178-11ee-a758-e0be038740d4', '02470e78-c178-11ee-a758-e0be038740d4', '', '', '', '保存', '', 'generator:save', 0, NULL, 0, 0, 0, 0, 0, '2024-02-02 11:07:14', '2024-02-02 11:07:14', '');
INSERT INTO `sys_menu` VALUES ('37536b9d-c178-11ee-a758-e0be038740d4', '02470e78-c178-11ee-a758-e0be038740d4', '', '', '', '修改', '', 'generator:update', 1, NULL, 0, 0, 0, 0, 0, '2024-02-02 11:07:36', '2024-02-02 11:07:36', '');
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 ('44692cac-c178-11ee-a758-e0be038740d4', '02470e78-c178-11ee-a758-e0be038740d4', '', '', '', '删除', '', 'generator:delete', 2, NULL, 0, 0, 0, 0, 0, '2024-02-02 11:07:58', '2024-02-02 11:07:58', '');
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 ('68de23e6-06c2-11f0-b559-4ccc6a2e3718', '7840fc2e-0401-11f0-b559-4ccc6a2e370', 'modelAdd', '/work/ModelAdd', 'DocumentAdd', '新增模型', 'ModelAdd', NULL, 1, NULL, 0, 2, 0, 1, 1, '2025-03-30 22:37:03', '2025-03-22 10:07:30', '');
INSERT INTO `sys_menu` VALUES ('7840fc2e-0401-11f0-b559-4ccc6a2e370', '0', 'work', '/work', 'Operation', '工作流', 'Work', NULL, 3, NULL, 0, 0, 0, 1, 1, '2025-03-22 10:21:10', '2025-03-18 22:01:20', '');
INSERT INTO `sys_menu` VALUES ('7840fc2e-0401-11f0-b559-4ccc6a2e3718', '7840fc2e-0401-11f0-b559-4ccc6a2e370', 'model', '/work/Model', 'Operation', '模型管理', 'Model', NULL, 0, NULL, 0, 0, 0, 1, 1, '2025-03-25 21:18:13', '2025-03-18 22:01:20', '');
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 ('db608f30-06ba-11f0-b559-4ccc6a2e3718', '7840fc2e-0401-11f0-b559-4ccc6a2e3718', '', '', '', '保存', '', 'model:save', 0, NULL, 0, 0, 0, 0, 0, '2025-03-25 21:18:30', '2025-03-22 09:13:26', '');
INSERT INTO `sys_menu` VALUES ('e5c47de2-06ba-11f0-b559-4ccc6a2e3718', '7840fc2e-0401-11f0-b559-4ccc6a2e3718', '', '', '', '修改', '', 'model:update', 1, NULL, 0, 0, 0, 0, 0, '2025-03-25 21:18:37', '2025-03-22 09:13:43', '');
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 ('f4b37ac9-06ba-11f0-b559-4ccc6a2e3718', '7840fc2e-0401-11f0-b559-4ccc6a2e3718', '', '', '', '删除', '', 'model:delete', 2, NULL, 0, 0, 0, 0, 0, '2025-03-25 21:18:46', '2025-03-22 09:14:08', '');
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 ('fc793c0e-097b-11f0-b559-4ccc6a2e3718', '7840fc2e-0401-11f0-b559-4ccc6a2e370', 'flowable', '/work/Flowable', 'ScaleToOriginal', '流程管理', 'Flowable', NULL, 2, NULL, 0, 0, 0, 1, 1, '2025-03-30 22:43:18', '2025-03-25 21:20:56', '');
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', '');
INSERT INTO `sys_menu` VALUES ('fe325d23-06ba-11f0-b559-4ccc6a2e3718', '7840fc2e-0401-11f0-b559-4ccc6a2e3718', '', '', '', '列表', '', 'model:list', 3, NULL, 0, 0, 0, 0, 0, '2025-03-25 21:18:54', '2025-03-22 09:14:24', '');

-- ----------------------------
-- 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
-- ----------------------------
INSERT INTO `sys_oper_log` VALUES ('16e783b21efc4702af60867be77949d6', NULL, 'GET', 'GET', NULL, '{}', NULL, 7, '1', NULL, 0, '/tansci/system/user/info', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:52:54');
INSERT INTO `sys_oper_log` VALUES ('1e4d7dfedb0444068d260af1e9fc5f33', NULL, 'GET', 'GET', NULL, '{}', NULL, 8, '1', NULL, 0, '/tansci/system/work/workflow/modelList', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:49');
INSERT INTO `sys_oper_log` VALUES ('2331debf5c1f41fa8dee046259df06fe', NULL, 'GET', 'GET', NULL, '{}', NULL, 10, '1', NULL, 0, '/tansci/system/dict/tree', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:09');
INSERT INTO `sys_oper_log` VALUES ('27f7b5f35e04403d951b4ebe603a384f', NULL, 'GET', 'GET', NULL, '{}', NULL, 8, '1', NULL, 0, '/tansci/lowcode/lcPages/pagesInfo/d2df5734-1ca6-11ee-8b16-e0be038740d4', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:54:22');
INSERT INTO `sys_oper_log` VALUES ('2a5e2d877a6048dfa7ba65f419ff8dd1', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 4, '1', NULL, 0, '/tansci/monitor/operLog', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:54:28');
INSERT INTO `sys_oper_log` VALUES ('2a924cea7d9a43c2a5503c2fa9fb84ab', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 10, '1', NULL, 0, '/tansci/system/role/page', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:04');
INSERT INTO `sys_oper_log` VALUES ('3edcd80aefc14f80b1731e0df09831cd', NULL, 'GET', 'GET', NULL, '{\"total\":\"20\",\"size\":\"20\"}', NULL, 6, '1', NULL, 0, '/tansci/monitor/operLog', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:54:03');
INSERT INTO `sys_oper_log` VALUES ('5100f19d45804ba29f3f36762755f0c8', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 5, '1', NULL, 0, '/tansci/monitor/operLog', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:57');
INSERT INTO `sys_oper_log` VALUES ('58ae271ff96a40c9b6c6ab4c82d94ee9', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"0\",\"size\":\"8\"}', NULL, 21, '1', NULL, 0, '/tansci/lowcode/lcPages/page', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:14');
INSERT INTO `sys_oper_log` VALUES ('58f6d3b3bef842659f31b4e6bed948fc', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 5, '1', NULL, 0, '/tansci/lowcode/generator/page', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:30');
INSERT INTO `sys_oper_log` VALUES ('647a78a1cdfe4e3f80c9f50da23632d6', NULL, 'GET', 'GET', NULL, '{}', NULL, 5, '1', NULL, 0, '/tansci/lowcode/lcPages/pagesInfo/eb404f1c-1ca6-11ee-8b16-e0be038740d4', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:54:26');
INSERT INTO `sys_oper_log` VALUES ('6abc1bd9b1d34fcc9bb59f896218d18b', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 4, '1', NULL, 0, '/tansci/monitor/loginLog', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:54:06');
INSERT INTO `sys_oper_log` VALUES ('6ad4eb9848c149db82e97898c8c18d50', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 9, '1', NULL, 0, '/tansci/system/work/model/page', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:39');
INSERT INTO `sys_oper_log` VALUES ('6e45e713d099408788e0dd278bffac3e', NULL, 'GET', 'GET', NULL, '{}', NULL, 43, '1', NULL, 0, '/tansci/system/menu/menus', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:52:54');
INSERT INTO `sys_oper_log` VALUES ('6f8cdf002b0f46a0bfd90dbe5abaa176', NULL, 'GET', 'GET', NULL, '{}', NULL, 31, '1', NULL, 0, '/tansci/system/menu/tree', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:00');
INSERT INTO `sys_oper_log` VALUES ('76113543013c4be4b16f8b1dc3e3c3ea', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 5, '1', NULL, 0, '/tansci/monitor/loginLog', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:52');
INSERT INTO `sys_oper_log` VALUES ('793605184cb84778b4f002e56c406789', NULL, 'GET', 'GET', NULL, '{}', NULL, 6, '1', NULL, 0, '/tansci/system/dict/list', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:52:54');
INSERT INTO `sys_oper_log` VALUES ('7bce8194199740f188f50048b2425fc3', NULL, 'POST', 'POST', NULL, '{}', NULL, 258, '1', NULL, 0, '/tansci/system/auth/login', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:52:54');
INSERT INTO `sys_oper_log` VALUES ('7cb1f2d7becf4f738a2437a47675be6b', NULL, 'GET', 'GET', NULL, '{}', NULL, 9, '1', NULL, 0, '/tansci/system/work/workflow/processDefinitionList', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:46');
INSERT INTO `sys_oper_log` VALUES ('949621e0b1804b209fd2d5c503a514d7', NULL, 'GET', 'GET', NULL, '{}', NULL, 9, '1', NULL, 0, '/tansci/lowcode/lcPages/classify/list', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:14');
INSERT INTO `sys_oper_log` VALUES ('aabcf046c007404188bb77e089bf5618', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"size\":\"10\",\"title\":\"\"}', NULL, 4, '1', NULL, 0, '/tansci/lowcode/lcPages/page', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:54:23');
INSERT INTO `sys_oper_log` VALUES ('b099a5987f074479893b1b51b3e13eea', NULL, 'GET', 'GET', NULL, '{}', NULL, 10, '1', NULL, 0, '/tansci/system/org/list', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:02');
INSERT INTO `sys_oper_log` VALUES ('bbc848d4e59b485bb702fee1b856c4cd', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 11, '1', NULL, 0, '/tansci/monitor/onlineUser', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:56');
INSERT INTO `sys_oper_log` VALUES ('ce48d3c42b574a2282bbe972c52c642b', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 6, '1', NULL, 0, '/tansci/system/user/page', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:11');
INSERT INTO `sys_oper_log` VALUES ('e18345b93d134233b235800960b432c4', NULL, 'GET', 'GET', NULL, '{}', NULL, 30, '1', NULL, 0, '/tansci/system/role/menuList/441b6dae329b3a20ad8b4f4ca8f83a0b', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:07');
INSERT INTO `sys_oper_log` VALUES ('f1c3b46c4ee34320baee2ea4e0e86948', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 4, '1', NULL, 0, '/tansci/monitor/onlineUser', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:54:09');
INSERT INTO `sys_oper_log` VALUES ('f4e6ca5118534802abc25f819325f3f0', NULL, 'GET', 'GET', NULL, '{}', NULL, 25, '1', NULL, 0, '/tansci/system/work/workflow/taskList', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:48');
INSERT INTO `sys_oper_log` VALUES ('f963b845dd2d4e8ea07056a39d6eafdb', NULL, 'GET', 'GET', NULL, '{\"current\":\"1\",\"total\":\"1\",\"size\":\"10\"}', NULL, 5, '1', NULL, 0, '/tansci/monitor/operLog', '127.0.0.1', NULL, '2.0.0', '2025-03-31 17:53:53');

-- ----------------------------
-- 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', '管理者', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 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;
