diff --git a/docs/pacAuth_database_0.2.ndm2 b/docs/pacAuth_database_0.2.ndm2 index 767f643..851fb60 100644 --- a/docs/pacAuth_database_0.2.ndm2 +++ b/docs/pacAuth_database_0.2.ndm2 @@ -357,8 +357,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_dept", - "comment": "系统组织架构", + "name": "pac_auth_post", + "comment": "岗位", "engine": "", "characterSet": "", "collation": "", @@ -422,7 +422,7 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": true, - "comment": "数据完整性确认", + "comment": "数据完整性验证", "columnFormat": "", "storage": "", "isVirtual": false, @@ -433,7 +433,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "dept_id", + "name": "post_id", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -448,46 +448,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "组织/部门id", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "dept_id" - }, - { - "objectType": "TableField_MYSQL", - "name": "pid", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "父id", + "comment": "岗位id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "pid" + "oldName": "post_id" }, { "objectType": "TableField_MYSQL", - "name": "grade", - "type": "int", - "length": -2147483648, + "name": "post_key", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -500,18 +474,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门等级,下级部门自动+1", + "comment": "岗位标识", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "grade" + "oldName": "post_key" }, { "objectType": "TableField_MYSQL", - "name": "dept_name", + "name": "post_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -526,18 +500,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门名称", + "comment": "岗位名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_name" + "oldName": "post_name" }, { "objectType": "TableField_MYSQL", - "name": "dept_desc", + "name": "post_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -552,92 +526,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门描述", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "dept_desc" - }, - { - "objectType": "TableField_MYSQL", - "name": "dept_type", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "部门类型", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "dept_type" - }, - { - "objectType": "TableField_MYSQL", - "name": "dept_leader", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "部门负责人,默认可以没有", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "dept_leader" - }, - { - "objectType": "TableField_MYSQL", - "name": "default_role", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "默认角色,默认可以没有", + "comment": "岗位描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "default_role" + "oldName": "post_desc" }, { "objectType": "TableField_MYSQL", @@ -656,7 +552,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序,默认0", + "comment": "排序:默认0", "columnFormat": "", "storage": "", "isVirtual": false, @@ -682,7 +578,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:默认0启用,1禁用", + "comment": "状态:默认0可以用,1禁用", "columnFormat": "", "storage": "", "isVirtual": false, @@ -882,8 +778,8 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "dept_id", - "keyLength": -2147483648, + "name": "post_id", + "keyLength": 0, "order": "", "oldName": "" } @@ -899,8 +795,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_post", - "comment": "岗位", + "name": "pac_core_dict", + "comment": "核心字典", "engine": "", "characterSet": "", "collation": "", @@ -964,7 +860,7 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": true, - "comment": "数据完整性验证", + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, @@ -975,8 +871,8 @@ }, { "objectType": "TableField_MYSQL", - "name": "post_id", - "type": "int", + "name": "dict_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -990,44 +886,44 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位id", + "comment": "字典项id,", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_id" + "oldName": "dict_id" }, { "objectType": "TableField_MYSQL", - "name": "post_key", - "type": "varchar", - "length": 255, + "name": "pid", + "type": "bigint", + "length": -2147483648, "decimals": -2147483648, - "isUnsigned": false, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位标识", + "comment": "字典项的父id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_key" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "post_name", + "name": "dict_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1037,23 +933,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位名称", + "comment": "字典项的唯一标识,id的显式表达", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_name" + "oldName": "dict_key" }, { "objectType": "TableField_MYSQL", - "name": "post_desc", + "name": "dict_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1068,20 +964,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位描述", + "comment": "字典项描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_desc" + "oldName": "dict_desc" }, { "objectType": "TableField_MYSQL", - "name": "order_num", - "type": "int", - "length": -2147483648, + "name": "dict_name", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1091,23 +987,23 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序:默认0", + "comment": "字典项名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "dict_name" }, { "objectType": "TableField_MYSQL", - "name": "status", - "type": "int", - "length": -2147483648, + "name": "dict_icon", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1116,26 +1012,26 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", + "defaultType": "Empty", + "defaultValue": "Empty String", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:默认0可以用,1禁用", + "comment": "字典项的图标", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "dict_icon" }, { "objectType": "TableField_MYSQL", - "name": "createby", + "name": "dict_type", "type": "int", - "length": 0, - "decimals": 0, - "isUnsigned": false, + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -1143,25 +1039,25 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "字典类型:0字符串、1图片、2图标,后面可拓展", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "dict_type" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, - "isUnsigned": false, + "name": "root", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -1169,34 +1065,190 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "默认0公有数据", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" + "oldName": "root" }, { "objectType": "TableField_MYSQL", - "name": "updateby", + "name": "order_num", "type": "int", - "length": 0, - "decimals": 0, - "isUnsigned": false, + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "排序,默认0", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "order_num" + }, + { + "objectType": "TableField_MYSQL", + "name": "status", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "字典状态:0正常、1禁用可读", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "status" + }, + { + "objectType": "TableField_MYSQL", + "name": "serviceKey", + "type": "varchar", + "length": 255, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Empty", + "defaultValue": "Empty String", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "所属服务:0归属于当前服务:pacAuth", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "serviceKey" + }, + { + "objectType": "TableField_MYSQL", + "name": "have_children", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "是否含有子节点:默认0不含有,1含有", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "have_children" + }, + { + "objectType": "TableField_MYSQL", + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "创建人", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "createby" + }, + { + "objectType": "TableField_MYSQL", + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "创建时间", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "createtime" + }, + { + "objectType": "TableField_MYSQL", + "name": "updateby", + "type": "bigint", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", + "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, "comment": "更新人", "columnFormat": "", @@ -1236,7 +1288,7 @@ { "objectType": "TableField_MYSQL", "name": "deleteby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -1320,8 +1372,8 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "post_id", - "keyLength": 0, + "name": "dict_id", + "keyLength": -2147483648, "order": "", "oldName": "" } @@ -1337,8 +1389,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_user", - "comment": "用户表", + "name": "pac_core_menu", + "comment": "系统菜单", "engine": "", "characterSet": "", "collation": "", @@ -1413,7 +1465,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "menu_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -1428,20 +1480,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户id,可采用雪花id", + "comment": "菜单ID", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "menu_id" }, { "objectType": "TableField_MYSQL", - "name": "username", - "type": "varchar", - "length": 255, + "name": "pid", + "type": "bigint", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1451,23 +1503,23 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户名", + "comment": "父ID", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "username" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "password", - "type": "varchar", - "length": 255, + "name": "have_children", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1477,21 +1529,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "密码", + "comment": "是否含有子节点:默认0不含有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "password" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "nickname", + "name": "api_path", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1501,25 +1553,25 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "昵称", + "comment": "后端权限地址", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "nickname" + "oldName": "api_path" }, { "objectType": "TableField_MYSQL", - "name": "user_type", - "type": "int", - "length": -2147483648, + "name": "web_path", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1527,23 +1579,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户类型,来源英语字典,默认0", + "comment": "前端路由地址", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_type" + "oldName": "web_path" }, { "objectType": "TableField_MYSQL", - "name": "user_email", + "name": "web_component_path", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1554,24 +1606,24 @@ "charset": "", "collation": "", "isNullable": true, - "defaultType": "Others", - "defaultValue": "", + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "邮箱", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_email" + "oldName": "web_component_path" }, { "objectType": "TableField_MYSQL", - "name": "pid", - "type": "bigint", - "length": -2147483648, + "name": "menu_name", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1581,23 +1633,23 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "父账户,默认0", + "comment": "菜单名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "pid" + "oldName": "menu_name" }, { "objectType": "TableField_MYSQL", - "name": "wx_appid", - "type": "int", - "length": -2147483648, + "name": "menu_desc", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1610,20 +1662,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "微信id", + "comment": "菜单描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "wx_appid" + "oldName": "menu_desc" }, { "objectType": "TableField_MYSQL", - "name": "avatar", - "type": "varchar", - "length": 255, + "name": "menu_type", + "type": "bigint", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1631,23 +1683,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "图标", + "comment": "菜单类型:来源于字典,默认0为默认类型", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "avatar" + "oldName": "menu_type" }, { "objectType": "TableField_MYSQL", - "name": "user_phone", + "name": "menu_icon", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1662,20 +1714,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "电话", + "comment": "菜单图标", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_phone" + "oldName": "menu_icon" }, { "objectType": "TableField_MYSQL", - "name": "user_desc", - "type": "varchar", - "length": 255, + "name": "is_frame", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1683,23 +1735,75 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户描述", + "comment": "是否是外链:默认0不是外链,1时外链", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_desc" + "oldName": "is_frame" }, { "objectType": "TableField_MYSQL", - "name": "status", + "name": "is_visible", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "1", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "是否为显示的菜单:默认0显示、1为不显示", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "is_visible" + }, + { + "objectType": "TableField_MYSQL", + "name": "is_activate", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "1", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "是否激活:默认0为激活可用状态,1为不可用", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "is_activate" + }, + { + "objectType": "TableField_MYSQL", + "name": "order_num", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -1714,18 +1818,18 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:0默认正常,1禁用,2临时锁定", + "comment": "排序:默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "order_num" }, { "objectType": "TableField_MYSQL", - "name": "have_children", + "name": "status", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -1740,14 +1844,40 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "存在子账户:默认0,不存在", + "comment": "菜单状态:0正常、1禁用", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" + "oldName": "status" + }, + { + "objectType": "TableField_MYSQL", + "name": "service_key", + "type": "varchar", + "length": 255, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "所属服务:0归属于当前服务:pacAuth", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "service_key" }, { "objectType": "TableField_MYSQL", @@ -1788,7 +1918,7 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "None", + "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, @@ -1932,32 +2062,6 @@ "oldName": "" } ] - }, - { - "objectType": "Index_MYSQL", - "name": "username", - "type": "UNIQUE", - "method": "", - "comment": "", - "oldName": "", - "online": false, - "keyBlockSize": 0, - "parser": "", - "algorithm": "", - "lock": "", - "collation": "", - "cardinality": "", - "packed": "", - "IsVisibleIndex": true, - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "username", - "keyLength": 0, - "order": "", - "oldName": "" - } - ] } ], "primaryKey": { @@ -1966,7 +2070,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "user_id", + "name": "menu_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -1983,8 +2087,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_dict", - "comment": "核心字典", + "name": "pac_core_env", + "comment": "系统内运行时的环境变量", "engine": "", "characterSet": "", "collation": "", @@ -2059,7 +2163,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "dict_id", + "name": "env_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -2074,14 +2178,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项id,", + "comment": "变量id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_id" + "oldName": "env_id" }, { "objectType": "TableField_MYSQL", @@ -2089,18 +2193,18 @@ "type": "bigint", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的父id", + "comment": "env分组依据,默认0为没有分组", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2111,7 +2215,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "dict_key", + "name": "env_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2126,18 +2230,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的唯一标识,id的显式表达", + "comment": "变量名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_key" + "oldName": "env_name" }, { "objectType": "TableField_MYSQL", - "name": "dict_desc", + "name": "env_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2147,23 +2251,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项描述", + "comment": "变量标识", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_desc" + "oldName": "env_key" }, { "objectType": "TableField_MYSQL", - "name": "dict_name", + "name": "env_val", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2178,18 +2282,44 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项名称", + "comment": "变量值", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_name" + "oldName": "env_val" }, { "objectType": "TableField_MYSQL", - "name": "dict_icon", + "name": "val_is_dict", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "数值来源于字典:默认0不来源于字典,1来源于字典", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "val_is_dict" + }, + { + "objectType": "TableField_MYSQL", + "name": "env_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2199,27 +2329,27 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Empty", - "defaultValue": "Empty String", + "isNullable": true, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的图标", + "comment": "变量描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_icon" + "oldName": "env_desc" }, { "objectType": "TableField_MYSQL", - "name": "dict_type", + "name": "have_children", "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -2230,14 +2360,14 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典类型:0字符串、1图片、2图标,后面可拓展", + "comment": "含有子节点:默认0不含有,1含有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_type" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", @@ -2245,7 +2375,7 @@ "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -2256,7 +2386,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认0公有数据", + "comment": "默认0,公共变量", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2271,7 +2401,7 @@ "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -2282,7 +2412,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序,默认0", + "comment": "排序:默认0", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2297,7 +2427,7 @@ "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -2308,7 +2438,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典状态:0正常、1禁用可读", + "comment": "变量状态:0正常、1不可用", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2319,7 +2449,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "serviceKey", + "name": "service_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2330,44 +2460,18 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Empty", - "defaultValue": "Empty String", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "所属服务:0归属于当前服务:pacAuth", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "serviceKey" - }, - { - "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, "defaultType": "Others", "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否含有子节点:默认0不含有,1含有", + "comment": "所属服务:0归属于当前服务:pacAuth", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" + "oldName": "service_key" }, { "objectType": "TableField_MYSQL", @@ -2560,7 +2664,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "dict_id", + "name": "env_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -2577,8 +2681,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_menu", - "comment": "系统菜单", + "name": "pac_auth_role", + "comment": "角色", "engine": "", "characterSet": "", "collation": "", @@ -2653,7 +2757,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "menu_id", + "name": "role_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -2668,14 +2772,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单ID", + "comment": "角色id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_id" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", @@ -2694,7 +2798,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "父ID", + "comment": "父id", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2705,85 +2809,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "是否含有子节点:默认0不含有", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "have_children" - }, - { - "objectType": "TableField_MYSQL", - "name": "api_path", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "后端权限地址", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "api_path" - }, - { - "objectType": "TableField_MYSQL", - "name": "web_path", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "前端路由地址", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "web_path" - }, - { - "objectType": "TableField_MYSQL", - "name": "web_component_path", + "name": "role_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2793,23 +2819,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "角色名", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "web_component_path" + "oldName": "role_name" }, { "objectType": "TableField_MYSQL", - "name": "menu_name", + "name": "role_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2824,18 +2850,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单名称", + "comment": "角色标识", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_name" + "oldName": "role_key" }, { "objectType": "TableField_MYSQL", - "name": "menu_desc", + "name": "role_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2850,18 +2876,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单描述", + "comment": "角色描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_desc" + "oldName": "role_desc" }, { "objectType": "TableField_MYSQL", - "name": "menu_type", + "name": "role_type", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -2876,44 +2902,18 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单类型:来源于字典,默认0为默认类型", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "menu_type" - }, - { - "objectType": "TableField_MYSQL", - "name": "menu_icon", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "菜单图标", + "comment": "来源于字典,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_icon" + "oldName": "role_type" }, { "objectType": "TableField_MYSQL", - "name": "is_frame", + "name": "dept_scope", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -2925,21 +2925,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "1", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否是外链:默认0不是外链,1时外链", + "comment": "数据范围:默认全部1(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "is_frame" + "oldName": "dept_scope" }, { "objectType": "TableField_MYSQL", - "name": "is_visible", + "name": "have_children", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -2951,21 +2951,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "1", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否为显示的菜单:默认0显示、1为不显示", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "is_visible" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "is_activate", + "name": "root", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -2977,17 +2977,17 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "1", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否激活:默认0为激活可用状态,1为不可用", + "comment": "1是属于Root的,无法删除和修改", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "is_activate" + "oldName": "root" }, { "objectType": "TableField_MYSQL", @@ -3032,7 +3032,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单状态:0正常、1禁用", + "comment": "状态:默认0可用,1禁用", "columnFormat": "", "storage": "", "isVirtual": false, @@ -3041,32 +3041,6 @@ "virtualType": "", "oldName": "status" }, - { - "objectType": "TableField_MYSQL", - "name": "service_key", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "所属服务:0归属于当前服务:pacAuth", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "service_key" - }, { "objectType": "TableField_MYSQL", "name": "createby", @@ -3258,7 +3232,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "menu_id", + "name": "role_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -3275,8 +3249,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_env", - "comment": "系统内运行时的环境变量", + "name": "pac_auth_link_user_post", + "comment": "用户岗位关联", "engine": "", "characterSet": "", "collation": "", @@ -3351,7 +3325,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "env_id", + "name": "user_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3366,18 +3340,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量id", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_id" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "pid", + "name": "post_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3389,50 +3363,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "env分组依据,默认0为没有分组", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "pid" + "oldName": "post_id" }, { "objectType": "TableField_MYSQL", - "name": "env_name", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "变量名称", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "env_name" - }, - { - "objectType": "TableField_MYSQL", - "name": "env_key", - "type": "varchar", - "length": 255, - "decimals": -2147483648, + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -3444,21 +3392,21 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量标识", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_key" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "env_val", - "type": "varchar", - "length": 255, - "decimals": -2147483648, + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -3470,70 +3418,118 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量值", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "env_val" - }, - { - "objectType": "TableField_MYSQL", - "name": "val_is_dict", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "数值来源于字典:默认0不来源于字典,1来源于字典", + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "val_is_dict" - }, + "oldName": "createtime" + } + ], + "indexes": [ { - "objectType": "TableField_MYSQL", - "name": "env_desc", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", + "objectType": "Index_MYSQL", + "name": "pac_index", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", "collation": "", - "isNullable": true, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "变量描述", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "env_desc" - }, + "cardinality": "", + "packed": "", + "IsVisibleIndex": true, + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": 0, + "order": "", + "oldName": "" + } + ] + } + ], + "primaryKey": { + "objectType": "PrimaryKey_MYSQL", + "name": "", + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": -2147483648, + "order": "", + "oldName": "" + } + ], + "oldName": "", + "indexMethod": "", + "comment": "" + }, + "foreignKeys": [], + "checks": [], + "triggers": [], + "tablePartitions": [] + }, + { + "objectType": "Table_MYSQL", + "name": "pac_auth_link_user_role", + "comment": "用户角色关联", + "engine": "", + "characterSet": "", + "collation": "", + "autoIncrement": 0, + "tablespace": "", + "storage": "", + "insertMethod": "", + "connection": "", + "checksum": false, + "rowFormat": "", + "avgRowLength": 0, + "maxRows": 0, + "minRows": 0, + "keyBlockSize": 0, + "packKeys": "", + "delayKeyWrite": false, + "dataDirectory": "", + "indexDirectory": "", + "statsAutoRecalc": "", + "statsPersistent": "", + "statsSamplePages": 0, + "union": "", + "pageCheckSum": false, + "transactional": false, + "compression": "", + "oldName": "", + "encryption": false, + "createOptions": "", + "createTime": "", + "checkTime": "", + "dataFree": 0, + "dataLength": 0, + "indexLength": 0, + "maxDataLength": 0, + "rows": 0, + "updateTime": "", + "DDL": "", + "partitionBy": "", + "partitionByExpr": "", + "partitions": 0, + "partitionKeyAlgorithm": "", + "subPartitionBy": "", + "subPartitionByExpr": "", + "subPartitions": 0, + "subPartitionKeyAlgorithm": "", + "fields": [ { "objectType": "TableField_MYSQL", - "name": "have_children", + "name": "index", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -3545,22 +3541,22 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "含有子节点:默认0不含有,1含有", + "isAutoInc": true, + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" + "oldName": "index" }, { "objectType": "TableField_MYSQL", - "name": "root", - "type": "int", + "name": "user_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -3571,22 +3567,22 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认0,公共变量", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "root" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "order_num", - "type": "int", + "name": "role_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -3597,24 +3593,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序:默认0", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", - "name": "status", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -3623,24 +3619,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量状态:0正常、1不可用", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "service_key", - "type": "varchar", - "length": 255, - "decimals": -2147483648, + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -3649,24 +3645,124 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "所属服务:0归属于当前服务:pacAuth", + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "service_key" - }, + "oldName": "createtime" + } + ], + "indexes": [ + { + "objectType": "Index_MYSQL", + "name": "pac_index", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", + "collation": "", + "cardinality": "", + "packed": "", + "IsVisibleIndex": true, + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": 0, + "order": "", + "oldName": "" + } + ] + } + ], + "primaryKey": { + "objectType": "PrimaryKey_MYSQL", + "name": "", + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": -2147483648, + "order": "", + "oldName": "" + } + ], + "oldName": "", + "indexMethod": "", + "comment": "" + }, + "foreignKeys": [], + "checks": [], + "triggers": [], + "tablePartitions": [] + }, + { + "objectType": "Table_MYSQL", + "name": "pac_auth_link_role_dept", + "comment": "角色的自定义数据权限范围(部门)", + "engine": "", + "characterSet": "", + "collation": "", + "autoIncrement": 0, + "tablespace": "", + "storage": "", + "insertMethod": "", + "connection": "", + "checksum": false, + "rowFormat": "", + "avgRowLength": 0, + "maxRows": 0, + "minRows": 0, + "keyBlockSize": 0, + "packKeys": "", + "delayKeyWrite": false, + "dataDirectory": "", + "indexDirectory": "", + "statsAutoRecalc": "", + "statsPersistent": "", + "statsSamplePages": 0, + "union": "", + "pageCheckSum": false, + "transactional": false, + "compression": "", + "oldName": "", + "encryption": false, + "createOptions": "", + "createTime": "", + "checkTime": "", + "dataFree": 0, + "dataLength": 0, + "indexLength": 0, + "maxDataLength": 0, + "rows": 0, + "updateTime": "", + "DDL": "", + "partitionBy": "", + "partitionByExpr": "", + "partitions": 0, + "partitionKeyAlgorithm": "", + "subPartitionBy": "", + "subPartitionByExpr": "", + "subPartitions": 0, + "subPartitionKeyAlgorithm": "", + "fields": [ { "objectType": "TableField_MYSQL", - "name": "createby", - "type": "bigint", - "length": 0, - "decimals": 0, + "name": "index", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -3677,22 +3773,22 @@ "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "创建人", + "isAutoInc": true, + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "index" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "role_id", + "type": "bigint", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -3704,70 +3800,44 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", - "name": "updateby", + "name": "dept_id", "type": "bigint", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "更新人", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "updateby" - }, - { - "objectType": "TableField_MYSQL", - "name": "updatetime", - "type": "datetime", - "length": 0, - "decimals": 0, + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "更新时间", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "updatetime" + "oldName": "dept_id" }, { "objectType": "TableField_MYSQL", - "name": "deleteby", + "name": "createby", "type": "bigint", "length": 0, "decimals": 0, @@ -3777,23 +3847,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "删除人", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "deleteby" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "deletetime", + "name": "createtime", "type": "datetime", "length": 0, "decimals": 0, @@ -3803,19 +3873,19 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "删除时间", + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "deletetime" + "oldName": "createtime" } ], "indexes": [ @@ -3849,15 +3919,7 @@ "primaryKey": { "objectType": "PrimaryKey_MYSQL", "name": "", - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "env_id", - "keyLength": -2147483648, - "order": "", - "oldName": "" - } - ], + "fields": [], "oldName": "", "indexMethod": "", "comment": "" @@ -3869,8 +3931,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_role", - "comment": "角色", + "name": "pac_auth_link_role_menu", + "comment": "角色菜单关联", "engine": "", "characterSet": "", "collation": "", @@ -3960,7 +4022,7 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "角色id", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, @@ -3971,7 +4033,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "pid", + "name": "menu_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3983,24 +4045,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "父id", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "pid" + "oldName": "menu_id" }, { "objectType": "TableField_MYSQL", - "name": "role_name", - "type": "varchar", - "length": 255, - "decimals": -2147483648, + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4012,21 +4074,21 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "角色名", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_name" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "role_key", - "type": "varchar", - "length": 255, - "decimals": -2147483648, + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4038,70 +4100,118 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "角色标识", + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_key" - }, + "oldName": "createtime" + } + ], + "indexes": [ { - "objectType": "TableField_MYSQL", - "name": "role_desc", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "角色描述", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "role_desc" - }, - { - "objectType": "TableField_MYSQL", - "name": "role_type", - "type": "bigint", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", + "objectType": "Index_MYSQL", + "name": "pac_index", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "来源于字典,默认0", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "role_type" - }, + "cardinality": "", + "packed": "", + "IsVisibleIndex": true, + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": 0, + "order": "", + "oldName": "" + } + ] + } + ], + "primaryKey": { + "objectType": "PrimaryKey_MYSQL", + "name": "", + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": -2147483648, + "order": "", + "oldName": "" + } + ], + "oldName": "", + "indexMethod": "", + "comment": "" + }, + "foreignKeys": [], + "checks": [], + "triggers": [], + "tablePartitions": [] + }, + { + "objectType": "Table_MYSQL", + "name": "pac_auth_link_user_dept", + "comment": "用户部门关联", + "engine": "", + "characterSet": "", + "collation": "", + "autoIncrement": 0, + "tablespace": "", + "storage": "", + "insertMethod": "", + "connection": "", + "checksum": false, + "rowFormat": "", + "avgRowLength": 0, + "maxRows": 0, + "minRows": 0, + "keyBlockSize": 0, + "packKeys": "", + "delayKeyWrite": false, + "dataDirectory": "", + "indexDirectory": "", + "statsAutoRecalc": "", + "statsPersistent": "", + "statsSamplePages": 0, + "union": "", + "pageCheckSum": false, + "transactional": false, + "compression": "", + "oldName": "", + "encryption": false, + "createOptions": "", + "createTime": "", + "checkTime": "", + "dataFree": 0, + "dataLength": 0, + "indexLength": 0, + "maxDataLength": 0, + "rows": 0, + "updateTime": "", + "DDL": "", + "partitionBy": "", + "partitionByExpr": "", + "partitions": 0, + "partitionKeyAlgorithm": "", + "subPartitionBy": "", + "subPartitionByExpr": "", + "subPartitions": 0, + "subPartitionKeyAlgorithm": "", + "fields": [ { "objectType": "TableField_MYSQL", - "name": "dept_scope", + "name": "index", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -4113,22 +4223,22 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "1", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "数据范围:默认全部1(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)", + "isAutoInc": true, + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_scope" + "oldName": "index" }, { "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", + "name": "user_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -4139,7 +4249,7 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, "comment": "", @@ -4149,64 +4259,12 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" - }, - { - "objectType": "TableField_MYSQL", - "name": "root", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "1是属于Root的,无法删除和修改", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "root" - }, - { - "objectType": "TableField_MYSQL", - "name": "order_num", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "排序:默认0", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "order_num" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "status", - "type": "int", + "name": "dept_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -4217,17 +4275,17 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:默认0可用,1禁用", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "dept_id" }, { "objectType": "TableField_MYSQL", @@ -4280,125 +4338,21 @@ "virtualExpr": "", "virtualType": "", "oldName": "createtime" - }, + } + ], + "indexes": [ { - "objectType": "TableField_MYSQL", - "name": "updateby", - "type": "bigint", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "更新人", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "updateby" - }, - { - "objectType": "TableField_MYSQL", - "name": "updatetime", - "type": "datetime", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "更新时间", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "updatetime" - }, - { - "objectType": "TableField_MYSQL", - "name": "deleteby", - "type": "bigint", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "删除人", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "deleteby" - }, - { - "objectType": "TableField_MYSQL", - "name": "deletetime", - "type": "datetime", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "删除时间", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "deletetime" - } - ], - "indexes": [ - { - "objectType": "Index_MYSQL", - "name": "pac_index", - "type": "UNIQUE", - "method": "", - "comment": "", - "oldName": "", - "online": false, - "keyBlockSize": 0, - "parser": "", - "algorithm": "", - "lock": "", + "objectType": "Index_MYSQL", + "name": "pac_index", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", "collation": "", "cardinality": "", "packed": "", @@ -4420,7 +4374,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "role_id", + "name": "index", "keyLength": -2147483648, "order": "", "oldName": "" @@ -4437,8 +4391,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_post", - "comment": "用户岗位关联", + "name": "pac_auth_dept", + "comment": "系统组织架构", "engine": "", "characterSet": "", "collation": "", @@ -4513,7 +4467,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "dept_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4528,18 +4482,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "组织/部门id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "dept_id" }, { "objectType": "TableField_MYSQL", - "name": "post_id", + "name": "pid", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4551,24 +4505,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "父id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_id" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "createby", - "type": "bigint", - "length": 0, - "decimals": 0, + "name": "grade", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4580,21 +4534,21 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "部门等级,下级部门自动+1", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "grade" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "dept_name", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4606,120 +4560,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "部门名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" - } - ], - "indexes": [ - { - "objectType": "Index_MYSQL", - "name": "pac_index", - "type": "UNIQUE", - "method": "", - "comment": "", - "oldName": "", - "online": false, - "keyBlockSize": 0, - "parser": "", - "algorithm": "", - "lock": "", - "collation": "", - "cardinality": "", - "packed": "", - "IsVisibleIndex": true, - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": 0, - "order": "", - "oldName": "" - } - ] - } - ], - "primaryKey": { - "objectType": "PrimaryKey_MYSQL", - "name": "", - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": -2147483648, - "order": "", - "oldName": "" - } - ], - "oldName": "", - "indexMethod": "", - "comment": "" - }, - "foreignKeys": [], - "checks": [], - "triggers": [], - "tablePartitions": [] - }, - { - "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_role", - "comment": "用户角色关联", - "engine": "", - "characterSet": "", - "collation": "", - "autoIncrement": 0, - "tablespace": "", - "storage": "", - "insertMethod": "", - "connection": "", - "checksum": false, - "rowFormat": "", - "avgRowLength": 0, - "maxRows": 0, - "minRows": 0, - "keyBlockSize": 0, - "packKeys": "", - "delayKeyWrite": false, - "dataDirectory": "", - "indexDirectory": "", - "statsAutoRecalc": "", - "statsPersistent": "", - "statsSamplePages": 0, - "union": "", - "pageCheckSum": false, - "transactional": false, - "compression": "", - "oldName": "", - "encryption": false, - "createOptions": "", - "createTime": "", - "checkTime": "", - "dataFree": 0, - "dataLength": 0, - "indexLength": 0, - "maxDataLength": 0, - "rows": 0, - "updateTime": "", - "DDL": "", - "partitionBy": "", - "partitionByExpr": "", - "partitions": 0, - "partitionKeyAlgorithm": "", - "subPartitionBy": "", - "subPartitionByExpr": "", - "subPartitions": 0, - "subPartitionKeyAlgorithm": "", - "fields": [ + "oldName": "dept_name" + }, { "objectType": "TableField_MYSQL", - "name": "index", - "type": "int", - "length": -2147483648, + "name": "dept_desc", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -4727,23 +4581,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": true, - "comment": "数据完整性确认", + "isAutoInc": false, + "comment": "部门描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "index" + "oldName": "dept_desc" }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "dept_type", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4755,21 +4609,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "部门类型", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "dept_type" }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "dept_leader", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4779,11 +4633,63 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, + "comment": "部门负责人,默认可以没有", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "dept_leader" + }, + { + "objectType": "TableField_MYSQL", + "name": "default_role", + "type": "bigint", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Others", + "defaultValue": "", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "默认角色,默认可以没有", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "default_role" + }, + { + "objectType": "TableField_MYSQL", + "name": "have_children", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, "comment": "", "columnFormat": "", "storage": "", @@ -4791,7 +4697,59 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "have_children" + }, + { + "objectType": "TableField_MYSQL", + "name": "order_num", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "排序,默认0", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "order_num" + }, + { + "objectType": "TableField_MYSQL", + "name": "status", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "状态:默认0启用,1禁用", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "status" }, { "objectType": "TableField_MYSQL", @@ -4844,6 +4802,110 @@ "virtualExpr": "", "virtualType": "", "oldName": "createtime" + }, + { + "objectType": "TableField_MYSQL", + "name": "updateby", + "type": "bigint", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "更新人", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "updateby" + }, + { + "objectType": "TableField_MYSQL", + "name": "updatetime", + "type": "datetime", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "更新时间", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "updatetime" + }, + { + "objectType": "TableField_MYSQL", + "name": "deleteby", + "type": "bigint", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "删除人", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "deleteby" + }, + { + "objectType": "TableField_MYSQL", + "name": "deletetime", + "type": "datetime", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "删除时间", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "deletetime" } ], "indexes": [ @@ -4880,7 +4942,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "index", + "name": "dept_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -4897,8 +4959,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_role_dept", - "comment": "角色的自定义数据权限范围(部门)", + "name": "pac_auth_user", + "comment": "用户表", "engine": "", "characterSet": "", "collation": "", @@ -4973,7 +5035,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "user_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4988,20 +5050,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "用户id,可采用雪花id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "dept_id", - "type": "bigint", - "length": -2147483648, + "name": "username", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -5014,21 +5076,21 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "用户名", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_id" + "oldName": "username" }, { "objectType": "TableField_MYSQL", - "name": "createby", - "type": "bigint", - "length": 0, - "decimals": 0, + "name": "password", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -5040,21 +5102,21 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "密码", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "password" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "nickname", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -5066,111 +5128,71 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "昵称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" - } - ], - "indexes": [ + "oldName": "nickname" + }, { - "objectType": "Index_MYSQL", - "name": "pac_index", - "type": "UNIQUE", - "method": "", - "comment": "", - "oldName": "", - "online": false, - "keyBlockSize": 0, - "parser": "", - "algorithm": "", - "lock": "", + "objectType": "TableField_MYSQL", + "name": "user_type", + "type": "bigint", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", "collation": "", - "cardinality": "", - "packed": "", - "IsVisibleIndex": true, - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": 0, - "order": "", - "oldName": "" - } - ] - } - ], - "primaryKey": { - "objectType": "PrimaryKey_MYSQL", - "name": "", - "fields": [], - "oldName": "", - "indexMethod": "", - "comment": "" - }, - "foreignKeys": [], - "checks": [], - "triggers": [], - "tablePartitions": [] - }, - { - "objectType": "Table_MYSQL", - "name": "pac_auth_link_role_menu", - "comment": "角色菜单关联", - "engine": "", - "characterSet": "", - "collation": "", - "autoIncrement": 0, - "tablespace": "", - "storage": "", - "insertMethod": "", - "connection": "", - "checksum": false, - "rowFormat": "", - "avgRowLength": 0, - "maxRows": 0, - "minRows": 0, - "keyBlockSize": 0, - "packKeys": "", - "delayKeyWrite": false, - "dataDirectory": "", - "indexDirectory": "", - "statsAutoRecalc": "", - "statsPersistent": "", - "statsSamplePages": 0, - "union": "", - "pageCheckSum": false, - "transactional": false, - "compression": "", - "oldName": "", - "encryption": false, - "createOptions": "", - "createTime": "", - "checkTime": "", - "dataFree": 0, - "dataLength": 0, - "indexLength": 0, - "maxDataLength": 0, - "rows": 0, - "updateTime": "", - "DDL": "", - "partitionBy": "", - "partitionByExpr": "", - "partitions": 0, - "partitionKeyAlgorithm": "", - "subPartitionBy": "", - "subPartitionByExpr": "", - "subPartitions": 0, - "subPartitionKeyAlgorithm": "", - "fields": [ + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "用户类型,来源英语字典,默认0", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "user_type" + }, { "objectType": "TableField_MYSQL", - "name": "index", - "type": "int", + "name": "user_email", + "type": "varchar", + "length": 255, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Others", + "defaultValue": "", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "邮箱", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "user_email" + }, + { + "objectType": "TableField_MYSQL", + "name": "pid", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -5179,25 +5201,103 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "父账户,默认0", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "pid" + }, + { + "objectType": "TableField_MYSQL", + "name": "wx_appid", + "type": "varchar", + "length": 255, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Others", + "defaultValue": "", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "微信id", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "wx_appid" + }, + { + "objectType": "TableField_MYSQL", + "name": "avatar", + "type": "varchar", + "length": 255, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, + "defaultType": "Others", + "defaultValue": "", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "图标", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "avatar" + }, + { + "objectType": "TableField_MYSQL", + "name": "user_phone", + "type": "varchar", + "length": 255, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": true, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": true, - "comment": "数据完整性确认", + "isAutoInc": false, + "comment": "电话", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "index" + "oldName": "user_phone" }, { "objectType": "TableField_MYSQL", - "name": "role_id", - "type": "bigint", - "length": -2147483648, + "name": "user_desc", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -5205,24 +5305,24 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "用户描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "user_desc" }, { "objectType": "TableField_MYSQL", - "name": "menu_id", - "type": "bigint", + "name": "status", + "type": "int", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -5233,24 +5333,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "状态:0默认正常,1禁用,2临时锁定", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_id" + "oldName": "status" }, { "objectType": "TableField_MYSQL", - "name": "createby", - "type": "bigint", - "length": 0, - "decimals": 0, + "name": "have_children", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -5259,22 +5359,22 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "存在子账户:默认0,不存在", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", + "name": "createby", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -5288,121 +5388,21 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" - } - ], - "indexes": [ - { - "objectType": "Index_MYSQL", - "name": "pac_index", - "type": "UNIQUE", - "method": "", - "comment": "", - "oldName": "", - "online": false, - "keyBlockSize": 0, - "parser": "", - "algorithm": "", - "lock": "", - "collation": "", - "cardinality": "", - "packed": "", - "IsVisibleIndex": true, - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": 0, - "order": "", - "oldName": "" - } - ] - } - ], - "primaryKey": { - "objectType": "PrimaryKey_MYSQL", - "name": "", - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": -2147483648, - "order": "", - "oldName": "" - } - ], - "oldName": "", - "indexMethod": "", - "comment": "" - }, - "foreignKeys": [], - "checks": [], - "triggers": [], - "tablePartitions": [] - }, - { - "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_dept", - "comment": "用户部门关联", - "engine": "", - "characterSet": "", - "collation": "", - "autoIncrement": 0, - "tablespace": "", - "storage": "", - "insertMethod": "", - "connection": "", - "checksum": false, - "rowFormat": "", - "avgRowLength": 0, - "maxRows": 0, - "minRows": 0, - "keyBlockSize": 0, - "packKeys": "", - "delayKeyWrite": false, - "dataDirectory": "", - "indexDirectory": "", - "statsAutoRecalc": "", - "statsPersistent": "", - "statsSamplePages": 0, - "union": "", - "pageCheckSum": false, - "transactional": false, - "compression": "", - "oldName": "", - "encryption": false, - "createOptions": "", - "createTime": "", - "checkTime": "", - "dataFree": 0, - "dataLength": 0, - "indexLength": 0, - "maxDataLength": 0, - "rows": 0, - "updateTime": "", - "DDL": "", - "partitionBy": "", - "partitionByExpr": "", - "partitions": 0, - "partitionKeyAlgorithm": "", - "subPartitionBy": "", - "subPartitionByExpr": "", - "subPartitions": 0, - "subPartitionKeyAlgorithm": "", - "fields": [ + "oldName": "createby" + }, { "objectType": "TableField_MYSQL", - "name": "index", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -5410,74 +5410,74 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Others", + "defaultType": "None", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": true, - "comment": "数据完整性确认", + "isAutoInc": false, + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "index" + "oldName": "createtime" }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "updateby", "type": "bigint", - "length": -2147483648, - "decimals": -2147483648, + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "更新人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "updateby" }, { "objectType": "TableField_MYSQL", - "name": "dept_id", - "type": "bigint", - "length": -2147483648, - "decimals": -2147483648, + "name": "updatetime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "更新时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_id" + "oldName": "updatetime" }, { "objectType": "TableField_MYSQL", - "name": "createby", + "name": "deleteby", "type": "bigint", "length": 0, "decimals": 0, @@ -5487,23 +5487,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "删除人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "deleteby" }, { "objectType": "TableField_MYSQL", - "name": "createtime", + "name": "deletetime", "type": "datetime", "length": 0, "decimals": 0, @@ -5513,19 +5513,19 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "删除时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" + "oldName": "deletetime" } ], "indexes": [ @@ -5554,6 +5554,32 @@ "oldName": "" } ] + }, + { + "objectType": "Index_MYSQL", + "name": "username", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", + "collation": "", + "cardinality": "", + "packed": "", + "IsVisibleIndex": true, + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "username", + "keyLength": 0, + "order": "", + "oldName": "" + } + ] } ], "primaryKey": { @@ -5562,7 +5588,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "index", + "name": "user_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -5666,8 +5692,8 @@ "tableName": "pac_auth_dept", "x": 890, "y": 30, - "width": 306, - "height": 410, + "width": 325, + "height": 430, "isBold": false, "titleColor": { "r": 55, @@ -5698,8 +5724,8 @@ "tableName": "pac_auth_role", "x": 30, "y": 1130, - "width": 758, - "height": 410, + "width": 732, + "height": 430, "isBold": false, "titleColor": { "r": 55, @@ -5744,7 +5770,7 @@ "type": "table", "schemaName": "pacAuth0_2", "tableName": "pac_auth_link_role_menu", - "x": 1270, + "x": 1290, "y": 30, "width": 279, "height": 250, diff --git a/src/application/auth-role/auth-role.controller.ts b/src/application/auth-role/auth-role.controller.ts index b788bd9..4c272f4 100644 --- a/src/application/auth-role/auth-role.controller.ts +++ b/src/application/auth-role/auth-role.controller.ts @@ -6,7 +6,13 @@ import { ApiOperation, ApiProduces, ApiTags } from '@nestjs/swagger'; import { PacInfo } from '@common/decorator/pac-info/pac-info.decorator'; import { PacInfoType } from '@utils/myType'; import { query } from 'express'; -import { GetPacAuthRoleAllDto } from '@app/auth-role/dto/get-auth-role.dto'; +import { + GetPacAuthRoleAllDto, + GetUserForRoleDto +} from "@app/auth-role/dto/get-auth-role.dto"; +import { + RoleLinkUserDto +} from "@app/auth-role/dto/roleLinkUser.dto"; @ApiTags('角色服务') @Controller('authRole') @@ -32,6 +38,7 @@ export class AuthRoleController { findAll(@Query() getPacAuthRoleAllDto: GetPacAuthRoleAllDto) { return this.authRoleService.findAll(getPacAuthRoleAllDto); } + @ApiOperation({ summary: '获取角色详细信息', description: '查询角色详细信息,目录菜单列表,数据权限范围', @@ -42,6 +49,16 @@ export class AuthRoleController { return this.authRoleService.findOne(id); } + @ApiOperation({ + summary: '获取角色树', + description: '查询角色基本信息,树结构', + }) + @ApiProduces('application/json') + @Get('/tree/:pid') + findTree(@Param('pid') pid: string) { + return this.authRoleService.findTree(pid); + } + @ApiOperation({ summary: '更新角色信息', description: '更新角色信息', @@ -51,6 +68,7 @@ export class AuthRoleController { update(@Param('id') id: string, @Body() updateAuthRoleDto: UpdateAuthRoleDto, @PacInfo() pacInfo: PacInfoType) { return this.authRoleService.update(id, updateAuthRoleDto, pacInfo); } + @ApiOperation({ summary: '删除目标角色', description: '删除目标角色信息', @@ -60,4 +78,35 @@ export class AuthRoleController { remove(@Param('id') id: string, @PacInfo() pacInfo: PacInfoType) { return this.authRoleService.remove(id, pacInfo); } + + @ApiOperation({ + summary: '获取角色下关联的账户', + description: '查询角色保定的用户', + }) + @ApiProduces('application/json') + @Get('/user/:roleId') + findUserByRoleId(@Param('roleId') roleId: string, @Query() getUserForRoleDto: GetUserForRoleDto) { + return this.authRoleService.findUserByRoleId(roleId, getUserForRoleDto); + } + + @ApiOperation({ + summary: '给角色绑定账户', + description: '给角色关联上账户,最大200个', + }) + @ApiProduces('application/json') + @Post('/user') + linkUser(@Body() roleLinkUserDto: RoleLinkUserDto, @PacInfo() pacInfo: PacInfoType) { + return this.authRoleService.linkUser(roleLinkUserDto, pacInfo); + } + + @ApiOperation({ + summary: '给角色解绑账户', + description: '给角色取消关联上账户,最大200个', + }) + @ApiProduces('application/json') + @Delete('/user') + unlinkUser(@Body() roleLinkUserDto: RoleLinkUserDto) { + console.log(roleLinkUserDto); + return this.authRoleService.unlinkUser(roleLinkUserDto); + } } diff --git a/src/application/auth-role/auth-role.service.ts b/src/application/auth-role/auth-role.service.ts index d5b41ab..aab1e9f 100644 --- a/src/application/auth-role/auth-role.service.ts +++ b/src/application/auth-role/auth-role.service.ts @@ -8,11 +8,22 @@ import { Snowflake } from '@service/snowflake/snowflake.service'; import { ConfigService } from '@nestjs/config'; import { PacInfoType } from '@utils/myType'; import { isExistKey, isTrueEnum } from '@utils/boolean.enum'; -import { pacAuthDept, pacAuthLinkRoleDept, pacAuthLinkRoleMenu, pacAuthRole, pacAuthUser, pacCoreDict, pacCoreMenu } from '@entities/schema'; -import { and, asc, desc, eq, isNull, like, or, sql } from 'drizzle-orm'; -import { GetPacAuthRoleAllDto } from '@app/auth-role/dto/get-auth-role.dto'; +import { + pacAuthDept, + pacAuthLinkRoleDept, + pacAuthLinkRoleMenu, + pacAuthLinkUserRole, + pacAuthRole, + pacAuthUser, + pacCoreDict, + pacCoreMenu, +} from '@entities/schema'; +import { and, asc, desc, eq, inArray, isNull, like, or, SQL, sql } from 'drizzle-orm'; +import { GetPacAuthRoleAllDto, GetUserForRoleDto } from '@app/auth-role/dto/get-auth-role.dto'; import { likeQuery } from '@utils/likeQuery'; -import { alias } from 'drizzle-orm/mysql-core'; +import { alias, QueryBuilder } from 'drizzle-orm/mysql-core'; +import { customDrizzleRowWithRecursive } from '@utils/customDrizzleRowWithRecursive'; +import { RoleLinkUserDto } from '@app/auth-role/dto/roleLinkUser.dto'; @Injectable() export class AuthRoleService { @@ -38,28 +49,6 @@ export class AuthRoleService { updatetime: pacAuthRole.updatetime, }; - // 角色详细信息 - private readonly roleMoreType = { - roleId: pacAuthRole.roleId, - pid: pacAuthRole.pid, - roleName: pacAuthRole.roleName, - roleKey: pacAuthRole.roleKey, - roleDesc: pacAuthRole.roleDesc, - roleType: pacAuthRole.roleType, - roleTypeName: pacCoreDict.dictName, - roleTypeKey: pacCoreDict.dictKey, - deptScope: pacAuthRole.deptScope, - root: pacAuthRole.root, - orderNum: pacAuthRole.orderNum, - status: pacAuthRole.status, - createby: pacAuthRole.createby, - createName: pacAuthUser.nickname, - createtime: pacAuthRole.createtime, - updateby: pacAuthRole.updateby, - updateName: pacAuthUser.nickname, - updatetime: pacAuthRole.updatetime, - }; - // 角色列表/数信息 private readonly roleListType = { roleId: pacAuthRole.roleId, @@ -163,6 +152,25 @@ export class AuthRoleService { return this.getRoleMore(id); } + /** Service + * NAME: findTree + * DESC: 获取角色树结构信息 + * DATE: 2024-06-27 14:23:36 - + * */ + public async findTree(pid: string) { + const [result] = await this.getRoleTree(pid); + return result; + } + + /** Service + * NAME: findUserByRoleId + * DESC: 获取角色下的关联账户 + * DATE: 2024-06-27 14:49:42 - + * */ + public async findUserByRoleId(roleId: string, getUserForRoleDto: GetUserForRoleDto) { + return await this.getRoleUser(roleId, getUserForRoleDto); + } + public async update(roleId: string, updateAuthRoleDto: UpdateAuthRoleDto, pacInfo: PacInfoType) { // ! 查找角色信息 const roleData = await this.getRoleForRoleId(roleId); @@ -232,6 +240,24 @@ export class AuthRoleService { return await this.deleteRole(roleId, pacInfo.userId as any); } + /** Service + * NAME: linkUser + * DESC: 关联账户给角色 + * DATE: 2024-06-27 15:38:50 - + * */ + public async linkUser(roleLinkUserDto: RoleLinkUserDto, pacInfo: PacInfoType) { + return this.linkUserForRole(roleLinkUserDto, pacInfo); + } + + /** Service + * NAME: unlinkUser + * DESC: 取消关联账户给角色 + * DATE: 2024-06-27 15:38:54 - + * */ + public async unlinkUser(roleLinkUserDto: RoleLinkUserDto) { + return this.unlinkUserForRole(roleLinkUserDto); + } + // DB 通过roleKey查找角色信息 private getRoleForRoleKey(key: string) { return this.mysqlService.db @@ -387,11 +413,41 @@ export class AuthRoleService { } // DB 查角色树 - getRoleTree() {} + private getRoleTree(pid: string) { + // ! 基础层级 + const baseQueryBuilder = new QueryBuilder(); + const baseQuery = baseQueryBuilder + .select({ + ...this.roleListType, + level: sql`0`.as('level'), + }) + .from(pacAuthRole) + .leftJoin(pacCoreDict, eq(pacAuthRole.roleType, pacCoreDict.dictId)) + .where(and(isNull(pacAuthRole.deleteby), eq(pacAuthRole.pid, pid))); + + // ! 递归层级 + const recursiveQueryBuilder = new QueryBuilder(); + const recursiveQuery = recursiveQueryBuilder + .select({ + ...this.roleListType, + level: sql`roleHierarchy.level + 1`.as('level'), + }) + .from(pacAuthRole) + .leftJoin(pacCoreDict, eq(pacAuthRole.roleType, pacCoreDict.dictId)) + .where(isNull(pacAuthRole.deleteby)) + .innerJoin(sql`roleHierarchy`, sql`roleHierarchy.roleId = ${pacAuthRole.pid}`); + + const rowName: SQL = customDrizzleRowWithRecursive(this.roleListType); + + // ! 执行原始SQL查询 + return this.mysqlService.db.execute( + sql`WITH RECURSIVE roleHierarchy(${rowName}) AS(${baseQuery} UNION ALL ${recursiveQuery}) SELECT * FROM roleHierarchy`, + ); + } // DB 查角色详细信息 private async getRoleMore(roleId: string) { - // ! 定义2次连表查询的用户表 + // ! 定义2次连表查询的账户表 const userTable1 = alias(pacAuthUser, 'userTable1'); // ! 查询目标角色信息 @@ -514,4 +570,129 @@ export class AuthRoleService { }) .where(eq(pacAuthRole.roleId, roleId)); } + + // DB 查找角色下的账户查询构建 + private getRoleUserQuery(roleId: string, getUserForRoleDto: GetUserForRoleDto, selectData = null) { + const query = this.mysqlService.db + .select(selectData) + .from(pacAuthUser) + .orderBy(isTrueEnum(getUserForRoleDto.isAsc) ? asc(pacAuthUser.userId) : desc(pacAuthUser.userId)) + .leftJoin(pacCoreDict, eq(pacAuthUser.userType, pacCoreDict.dictId)) + .leftJoin(pacAuthLinkUserRole, eq(pacAuthLinkUserRole.userId, pacAuthUser.userId)) + .$dynamic(); + const wl = []; + + // ? 未删除 + wl.push(isNull(pacAuthUser.deleteby)); + + // ? 模糊查询 + wl.push( + or( + like(pacAuthUser.nickname, likeQuery(getUserForRoleDto.userInfo)), + like(pacAuthUser.userDesc, likeQuery(getUserForRoleDto.userInfo)), + like(pacAuthUser.userEmail, likeQuery(getUserForRoleDto.userInfo)), + like(pacAuthUser.userPhone, likeQuery(getUserForRoleDto.userInfo)), + like(pacAuthUser.username, likeQuery(getUserForRoleDto.userInfo)), + ).if(isExistKey(getUserForRoleDto, 'userInfo')), + ); + + // ? 目标roleId + wl.push(eq(pacAuthLinkUserRole.roleId, roleId)); + + // ? 用户类型 + wl.push(eq(pacAuthUser.userType, getUserForRoleDto.userType).if(isExistKey(getUserForRoleDto, 'userType'))); + query.where(and(...wl)); + return query; + } + + // DB 查找角色下的账户 + private async getRoleUser(roleId: string, getUserForRoleDto: GetUserForRoleDto) { + const offset = (getUserForRoleDto.pageNumber - 1) * getUserForRoleDto.pageSize; + + // ! 使用基础查询构建查询总记录数 + const totalCountQuery = this.getRoleData(getUserForRoleDto, { + totalCount: sql`COUNT(*)`, + }); + + // ! 使用基础查询构建分页查询 + // 重命名表 + const userTable1 = alias(pacAuthUser, 'userTable1'); + const userTable2 = alias(pacAuthUser, 'userTable2'); + const paginatedQuery = this.getRoleUserQuery(roleId, getUserForRoleDto, { + userId: pacAuthUser.userId, + username: pacAuthUser.username, + nickname: pacAuthUser.nickname, + userType: pacAuthUser.userType, + userTypeName: pacCoreDict.dictName, + userTypeKey: pacCoreDict.dictKey, + userEmail: pacAuthUser.userEmail, + avatar: pacAuthUser.avatar, + userPhone: pacAuthUser.userPhone, + userDesc: pacAuthUser.userDesc, + haveChildren: pacAuthUser.haveChildren, + createby: pacAuthUser.createby, + createName: userTable2.nickname, + createtime: pacAuthUser.createtime, + updateName: userTable1.nickname, + }) + .leftJoin(userTable2, eq(pacAuthUser.createby, userTable2.userId)) + .leftJoin(userTable1, eq(pacAuthUser.updateby, userTable1.userId)) + .limit(getUserForRoleDto.pageSize) + .offset(offset); + + return { + total: (await totalCountQuery)[0].totalCount, + rowData: await paginatedQuery, + searchData: getUserForRoleDto, + }; + } + + // DB 查找角色账户关联数据 + private async getRoleLinkUser(roleId: string, userIdList: string[]) { + return this.mysqlService.db + .select({ + id: pacAuthLinkUserRole.userId, + index: pacAuthLinkUserRole.index, + }) + .from(pacAuthLinkUserRole) + .where(and(eq(pacAuthLinkUserRole.roleId, roleId), inArray(pacAuthLinkUserRole.userId, userIdList))); + } + + // DB 给角色关联上账户 + private async linkUserForRole(roleLinkUserDto: RoleLinkUserDto, pacInfo: PacInfoType) { + // ! 去重账户ID + const deduplicateUserId = Array.from(new Set(roleLinkUserDto.userIdList)); + + // ! 查找角色是否存在这些账户 + const existUser = await this.getRoleLinkUser(roleLinkUserDto.roleId, deduplicateUserId); + + // ! 获取已存在的账户Id + const existUserIdList = existUser.map((user) => user.id); + + // ! 过滤已经存在的账户 + const userIdList = roleLinkUserDto.userIdList.filter((i) => !existUserIdList.includes(i)); + + return await this.mysqlService.db.insert(pacAuthLinkUserRole).values( + userIdList.map((i) => ({ + roleId: roleLinkUserDto.roleId, + userId: i, + createby: pacInfo.userId, + createtime: sql`now()` as any, + })), + ); + } + + // DB 取消角色关联的账户 + private async unlinkUserForRole(roleLinkUserDto: RoleLinkUserDto) { + // ! 去重账户ID + const deduplicateUserId = Array.from(new Set(roleLinkUserDto.userIdList)); + + // ! 查找角色是否存在这些账户 + const existUser = await this.getRoleLinkUser(roleLinkUserDto.roleId, deduplicateUserId); + + // ! 获取已存在的账户Id + const existUserIndexList = existUser.map((user) => user.index); + + return await this.mysqlService.db.delete(pacAuthLinkUserRole).where(inArray(pacAuthLinkUserRole.index, existUserIndexList)); + } } diff --git a/src/application/auth-role/dto/create-auth-role.dto.ts b/src/application/auth-role/dto/create-auth-role.dto.ts index bf878e9..a6f6638 100644 --- a/src/application/auth-role/dto/create-auth-role.dto.ts +++ b/src/application/auth-role/dto/create-auth-role.dto.ts @@ -118,6 +118,7 @@ export class CreateAuthRoleDto { @IsString({ each: true, message: '菜单id格式错误' }) @ArrayMinSize(1, { message: '至少需要选择一个菜单作为权限' }) @Length(19, 19, { each: true, message: '菜单id格式错误' }) + @IsOptional() readonly menuList?: string[]; @ApiProperty({ diff --git a/src/application/auth-role/dto/get-auth-role.dto.ts b/src/application/auth-role/dto/get-auth-role.dto.ts index 6a8a6f0..9a0ce0e 100644 --- a/src/application/auth-role/dto/get-auth-role.dto.ts +++ b/src/application/auth-role/dto/get-auth-role.dto.ts @@ -29,8 +29,8 @@ export class GetPacAuthRoleAllDto extends GetDto { maxLength: 128, }) @Trim() - @IsString({ message: '字典信息应为字符串格式!' }) - @Length(0, 128, { message: '请将字典信息长度控制在1到128位之间!' }) + @IsString({ message: '角色信息应为字符串格式!' }) + @Length(0, 128, { message: '请将角色信息长度控制在1到128位之间!' }) @IsOptional() readonly roleInfo?: string; @@ -61,7 +61,7 @@ export class GetPacAuthRoleAllDto extends GetDto { readonly root: BooleanEnum; @ApiProperty({ - description: '字典状态', + description: '角色状态', type: Number, example: 0, required: false, @@ -71,19 +71,19 @@ export class GetPacAuthRoleAllDto extends GetDto { @Trim() @Int() @IsInt({ - message: '字典状态必须是整数!', + message: '角色状态必须是整数!', }) @Min(-100, { - message: '字典状态需要大于-100!', + message: '角色状态需要大于-100!', }) @Max(100, { - message: '字典状态不能超过100', + message: '角色状态不能超过100', }) @IsOptional() readonly status?: string; @ApiProperty({ - description: '字典层级id', + description: '角色层级id', type: Number, example: 0, required: false, @@ -91,24 +91,38 @@ export class GetPacAuthRoleAllDto extends GetDto { maximum: 100, }) @Trim() - @IsString({ message: '字典层级id应为字符串格式!' }) - @Length(1, 20, { message: '字典层级id格式错误!' }) + @IsString({ message: '角色层级id应为字符串格式!' }) + @Length(1, 20, { message: '角色层级id格式错误!' }) @IsOptional() readonly hierarchy?: string; } -export class PacAuthRoleTargetListDto { +export class GetUserForRoleDto extends GetDto { @ApiProperty({ - description: '是否查找树结构', - type: BooleanEnum, - enum: BooleanEnum, - example: 0, + description: '用户信息', + type: String, + example: '哈哈', required: false, + minLength: 1, + maxLength: 128, }) @Trim() - @IsEnum(BooleanEnum, { - message: '查找树结构数据错误', + @IsString({ message: '用户信息应为字符串格式!' }) + @Length(0, 128, { message: '请将用户信息长度控制在1到128位之间!' }) + @IsOptional() + readonly userInfo?: string; + + @ApiProperty({ + description: '用户类型,来自于字典', + type: String, + example: '0', + required: false, + minLength: 19, + maxLength: 19, }) + @Trim() + @IsString({ message: '用户类型格式不正确!' }) + @Length(19, 19, { message: '用户类型格式不正确!' }) @IsOptional() - readonly isTree: BooleanEnum; + readonly userType: string; } diff --git a/src/application/auth-role/dto/roleLinkUser.dto.ts b/src/application/auth-role/dto/roleLinkUser.dto.ts new file mode 100644 index 0000000..344ca67 --- /dev/null +++ b/src/application/auth-role/dto/roleLinkUser.dto.ts @@ -0,0 +1,44 @@ +// | ------------------------------------------------------------ +// | @版本: version 0.1 +// | @创建人: 【Nie-x7129】 +// | @E-mail: x71291@outlook.com +// | @所在项目: pac-auth +// | @文件描述: roleLinkUser.dto.ts - +// | @创建时间: 2024-06-27 15:30 +// | @更新时间: 2024-06-27 15:30 +// | @修改记录: +// | -*-*-*- (时间--修改人--修改说明) -*-*-*- +// | = +// | ------------------------------------------------------------ + +import { ApiProperty } from '@nestjs/swagger'; +import Trim from '@common/decorator/trim/trim.decorator'; +import { ArrayMaxSize, ArrayMinSize, IsString, Length } from 'class-validator'; + +export class RoleLinkUserDto { + @ApiProperty({ + description: '角色ID', + type: String, + example: '0', + required: true, + minLength: 19, + maxLength: 19, + }) + @Trim() + @IsString({ message: '角色属性格式不正确!' }) + @Length(19, 19, { message: '角色属性格式不正确!' }) + readonly roleId: string; + + @ApiProperty({ + description: '账户Id列表', + type: [String], + example: ['a'], + required: true, + minItems: 1, + }) + @IsString({ each: true, message: '账户Id格式错误' }) + @ArrayMinSize(1, { message: '至少需要选择一个需要绑定的账户' }) + @ArrayMaxSize(200, { message: '需要绑定的账户账户超过限制' }) + @Length(19, 19, { each: true, message: '账户Id格式错误' }) + readonly userIdList?: string[]; +} diff --git a/src/entities/schema.ts b/src/entities/schema.ts index b765ad9..e5811f3 100644 --- a/src/entities/schema.ts +++ b/src/entities/schema.ts @@ -7,21 +7,22 @@ export const pacAuthDept = mysqlTable( 'pac_auth_dept', { index: int('index').autoincrement().notNull(), - deptId: int('dept_id').notNull(), - pid: int('pid').default(0).notNull(), + deptId: bigint('dept_id', { mode: 'number' }).notNull(), + pid: bigint('pid', { mode: 'number' }).notNull(), grade: int('grade').notNull(), - deptName: varchar('dept_name', { length: 255 }), + deptName: varchar('dept_name', { length: 255 }).notNull(), deptDesc: varchar('dept_desc', { length: 255 }), - deptType: int('dept_type').default(0).notNull(), - deptLeader: int('dept_leader'), - defaultRole: int('default_role'), + deptType: bigint('dept_type', { mode: 'number' }).notNull(), + deptLeader: bigint('dept_leader', { mode: 'number' }), + defaultRole: bigint('default_role', { mode: 'number' }), + haveChildren: int('have_children').default(0).notNull(), orderNum: int('order_num').default(0).notNull(), status: int('status').default(0).notNull(), - createby: int('createby').notNull(), + createby: bigint('createby', { mode: 'number' }).notNull(), createtime: datetime('createtime', { mode: 'string' }).notNull(), - updateby: int('updateby'), + updateby: bigint('updateby', { mode: 'number' }), updatetime: datetime('updatetime', { mode: 'string' }), - deleteby: int('deleteby'), + deleteby: bigint('deleteby', { mode: 'number' }), deletetime: datetime('deletetime', { mode: 'string' }), }, (table) => { @@ -179,10 +180,10 @@ export const pacAuthUser = mysqlTable( username: varchar('username', { length: 255 }).notNull(), password: varchar('password', { length: 255 }).notNull(), nickname: varchar('nickname', { length: 255 }).notNull(), - userType: int('user_type').default(0).notNull(), + userType: bigint('user_type', { mode: 'number' }).notNull(), userEmail: varchar('user_email', { length: 255 }), pid: bigint('pid', { mode: 'number' }).notNull(), - wxAppid: int('wx_appid'), + wxAppid: varchar('wx_appid', { length: 255 }), avatar: varchar('avatar', { length: 255 }), userPhone: varchar('user_phone', { length: 255 }), userDesc: varchar('user_desc', { length: 255 }),