diff --git a/docs/pacAuth_database_0.2.ndm2 b/docs/pacAuth_database_0.2.ndm2 index 851fb60..0bde462 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_post", - "comment": "岗位", + "name": "pac_core_dict", + "comment": "核心字典", "engine": "", "characterSet": "", "collation": "", @@ -422,7 +422,7 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": true, - "comment": "数据完整性验证", + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, @@ -433,8 +433,8 @@ }, { "objectType": "TableField_MYSQL", - "name": "post_id", - "type": "int", + "name": "dict_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -448,18 +448,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", + "name": "pid", + "type": "bigint", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, + "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": "pid" + }, + { + "objectType": "TableField_MYSQL", + "name": "dict_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -474,18 +500,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位标识", + "comment": "字典项的唯一标识,id的显式表达", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_key" + "oldName": "dict_key" }, { "objectType": "TableField_MYSQL", - "name": "post_name", + "name": "dict_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -500,18 +526,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位名称", + "comment": "字典项描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_name" + "oldName": "dict_desc" }, { "objectType": "TableField_MYSQL", - "name": "post_desc", + "name": "dict_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -521,19 +547,97 @@ "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": "post_desc" + "oldName": "dict_name" + }, + { + "objectType": "TableField_MYSQL", + "name": "dict_icon", + "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": "字典项的图标", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "dict_icon" + }, + { + "objectType": "TableField_MYSQL", + "name": "dict_type", + "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图片、2图标,后面可拓展", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "dict_type" + }, + { + "objectType": "TableField_MYSQL", + "name": "root", + "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公有数据", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "root" }, { "objectType": "TableField_MYSQL", @@ -541,7 +645,7 @@ "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": false, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -552,7 +656,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序:默认0", + "comment": "排序,默认0", "columnFormat": "", "storage": "", "isVirtual": false, @@ -567,7 +671,7 @@ "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": false, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -578,7 +682,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:默认0可以用,1禁用", + "comment": "字典状态:0正常、1禁用可读", "columnFormat": "", "storage": "", "isVirtual": false, @@ -589,8 +693,60 @@ }, { "objectType": "TableField_MYSQL", - "name": "createby", + "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, @@ -642,7 +798,7 @@ { "objectType": "TableField_MYSQL", "name": "updateby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -694,7 +850,7 @@ { "objectType": "TableField_MYSQL", "name": "deleteby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -778,8 +934,8 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "post_id", - "keyLength": 0, + "name": "dict_id", + "keyLength": -2147483648, "order": "", "oldName": "" } @@ -795,8 +951,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_dict", - "comment": "核心字典", + "name": "pac_core_menu", + "comment": "系统菜单", "engine": "", "characterSet": "", "collation": "", @@ -871,7 +1027,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "dict_id", + "name": "menu_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -886,14 +1042,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项id,", + "comment": "菜单ID", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_id" + "oldName": "menu_id" }, { "objectType": "TableField_MYSQL", @@ -901,18 +1057,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": "父ID", "columnFormat": "", "storage": "", "isVirtual": false, @@ -923,9 +1079,9 @@ }, { "objectType": "TableField_MYSQL", - "name": "dict_key", - "type": "varchar", - "length": 255, + "name": "have_children", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -935,21 +1091,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的唯一标识,id的显式表达", + "comment": "是否含有子节点:默认0不含有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_key" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "dict_desc", + "name": "api_path", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -960,22 +1116,22 @@ "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": "dict_desc" + "oldName": "api_path" }, { "objectType": "TableField_MYSQL", - "name": "dict_name", + "name": "web_path", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -985,23 +1141,49 @@ "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": "dict_name" + "oldName": "web_path" }, { "objectType": "TableField_MYSQL", - "name": "dict_icon", + "name": "web_component_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_component_path" + }, + { + "objectType": "TableField_MYSQL", + "name": "menu_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1012,26 +1194,52 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Empty", - "defaultValue": "Empty String", + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的图标", + "comment": "菜单名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_icon" + "oldName": "menu_name" }, { "objectType": "TableField_MYSQL", - "name": "dict_type", - "type": "int", + "name": "menu_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": "menu_desc" + }, + { + "objectType": "TableField_MYSQL", + "name": "menu_type", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -1042,22 +1250,48 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典类型:0字符串、1图片、2图标,后面可拓展", + "comment": "菜单类型:来源于字典,默认0为默认类型", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_type" + "oldName": "menu_type" }, { "objectType": "TableField_MYSQL", - "name": "root", + "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": "菜单图标", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "menu_icon" + }, + { + "objectType": "TableField_MYSQL", + "name": "is_frame", "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -1068,22 +1302,22 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认0公有数据", + "comment": "是否是外链:默认0不是外链,1时外链", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "root" + "oldName": "is_frame" }, { "objectType": "TableField_MYSQL", - "name": "order_num", + "name": "is_visible", "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -1091,25 +1325,25 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "1", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序,默认0", + "comment": "是否为显示的菜单:默认0显示、1为不显示", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "is_visible" }, { "objectType": "TableField_MYSQL", - "name": "status", + "name": "is_activate", "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -1117,23 +1351,23 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "1", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典状态:0正常、1禁用可读", + "comment": "是否激活:默认0为激活可用状态,1为不可用", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "is_activate" }, { "objectType": "TableField_MYSQL", - "name": "serviceKey", - "type": "varchar", - "length": 255, + "name": "order_num", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1142,22 +1376,22 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Empty", - "defaultValue": "Empty String", + "defaultType": "Others", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "所属服务:0归属于当前服务:pacAuth", + "comment": "排序:默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "serviceKey" + "oldName": "order_num" }, { "objectType": "TableField_MYSQL", - "name": "have_children", + "name": "status", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -1172,14 +1406,40 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否含有子节点:默认0不含有,1含有", + "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", @@ -1372,7 +1632,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "dict_id", + "name": "menu_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -1389,8 +1649,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_menu", - "comment": "系统菜单", + "name": "pac_core_env", + "comment": "系统内运行时的环境变量", "engine": "", "characterSet": "", "collation": "", @@ -1465,7 +1725,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "menu_id", + "name": "env_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -1480,14 +1740,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单ID", + "comment": "变量id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_id" + "oldName": "env_id" }, { "objectType": "TableField_MYSQL", @@ -1506,7 +1766,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "父ID", + "comment": "env分组依据,默认0为没有分组", "columnFormat": "", "storage": "", "isVirtual": false, @@ -1517,9 +1777,9 @@ }, { "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", - "length": -2147483648, + "name": "env_name", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1529,21 +1789,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否含有子节点:默认0不含有", + "comment": "变量名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" + "oldName": "env_name" }, { "objectType": "TableField_MYSQL", - "name": "api_path", + "name": "env_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1553,23 +1813,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": "api_path" + "oldName": "env_key" }, { "objectType": "TableField_MYSQL", - "name": "web_path", + "name": "env_val", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1579,25 +1839,25 @@ "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_path" + "oldName": "env_val" }, { "objectType": "TableField_MYSQL", - "name": "web_component_path", - "type": "varchar", - "length": 255, + "name": "val_is_dict", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1605,23 +1865,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "数值来源于字典:默认0不来源于字典,1来源于字典", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "web_component_path" + "oldName": "val_is_dict" }, { "objectType": "TableField_MYSQL", - "name": "menu_name", + "name": "env_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -1631,51 +1891,25 @@ "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": "menu_name" + "oldName": "env_desc" }, { "objectType": "TableField_MYSQL", - "name": "menu_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": "menu_desc" - }, - { - "objectType": "TableField_MYSQL", - "name": "menu_type", - "type": "bigint", - "length": -2147483648, + "name": "have_children", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1688,44 +1922,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不含有,1含有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_icon" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "is_frame", + "name": "root", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -1740,66 +1948,14 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否是外链:默认0不是外链,1时外链", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "is_frame" - }, - { - "objectType": "TableField_MYSQL", - "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为不可用", + "comment": "默认0,公共变量", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "is_activate" + "oldName": "root" }, { "objectType": "TableField_MYSQL", @@ -1844,7 +2000,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单状态:0正常、1禁用", + "comment": "变量状态:0正常、1不可用", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2070,7 +2226,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "menu_id", + "name": "env_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -2087,8 +2243,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_env", - "comment": "系统内运行时的环境变量", + "name": "pac_auth_role", + "comment": "角色", "engine": "", "characterSet": "", "collation": "", @@ -2163,7 +2319,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "env_id", + "name": "role_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -2178,14 +2334,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量id", + "comment": "角色id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_id" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", @@ -2204,7 +2360,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "env分组依据,默认0为没有分组", + "comment": "父id", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2215,7 +2371,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "env_name", + "name": "role_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2230,18 +2386,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量名称", + "comment": "角色名", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_name" + "oldName": "role_name" }, { "objectType": "TableField_MYSQL", - "name": "env_key", + "name": "role_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2256,18 +2412,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量标识", + "comment": "角色标识", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_key" + "oldName": "role_key" }, { "objectType": "TableField_MYSQL", - "name": "env_val", + "name": "role_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2277,24 +2433,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": "env_val" + "oldName": "role_desc" }, { "objectType": "TableField_MYSQL", - "name": "val_is_dict", - "type": "int", + "name": "role_type", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -2308,20 +2464,20 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "数值来源于字典:默认0不来源于字典,1来源于字典", + "comment": "来源于字典,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "val_is_dict" + "oldName": "role_type" }, { "objectType": "TableField_MYSQL", - "name": "env_desc", - "type": "varchar", - "length": 255, + "name": "dept_scope", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2329,19 +2485,19 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "1", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量描述", + "comment": "数据范围:默认全部1(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_desc" + "oldName": "dept_scope" }, { "objectType": "TableField_MYSQL", @@ -2360,7 +2516,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "含有子节点:默认0不含有,1含有", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2386,7 +2542,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认0,公共变量", + "comment": "1是属于Root的,无法删除和修改", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2438,7 +2594,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量状态:0正常、1不可用", + "comment": "状态:默认0可用,1禁用", "columnFormat": "", "storage": "", "isVirtual": false, @@ -2447,32 +2603,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", @@ -2664,7 +2794,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "env_id", + "name": "role_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -2681,8 +2811,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_role", - "comment": "角色", + "name": "pac_auth_link_user_post", + "comment": "用户岗位关联", "engine": "", "characterSet": "", "collation": "", @@ -2757,7 +2887,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "user_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -2772,18 +2902,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "角色id", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "pid", + "name": "post_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -2795,24 +2925,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": "post_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": "", @@ -2824,21 +2954,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": "", @@ -2850,70 +2980,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_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": "dept_scope", + "name": "index", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -2925,22 +3103,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, @@ -2951,7 +3129,7 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, "comment": "", @@ -2961,64 +3139,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": "role_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -3029,17 +3155,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": "role_id" }, { "objectType": "TableField_MYSQL", @@ -3092,125 +3218,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": "", @@ -3232,7 +3254,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "role_id", + "name": "index", "keyLength": -2147483648, "order": "", "oldName": "" @@ -3249,8 +3271,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_post", - "comment": "用户岗位关联", + "name": "pac_auth_link_role_dept", + "comment": "角色的自定义数据权限范围(部门)", "engine": "", "characterSet": "", "collation": "", @@ -3325,7 +3347,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "role_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3347,11 +3369,11 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", - "name": "post_id", + "name": "dept_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3373,7 +3395,7 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_id" + "oldName": "dept_id" }, { "objectType": "TableField_MYSQL", @@ -3459,15 +3481,7 @@ "primaryKey": { "objectType": "PrimaryKey_MYSQL", "name": "", - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": -2147483648, - "order": "", - "oldName": "" - } - ], + "fields": [], "oldName": "", "indexMethod": "", "comment": "" @@ -3479,8 +3493,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_role", - "comment": "用户角色关联", + "name": "pac_auth_link_role_menu", + "comment": "角色菜单关联", "engine": "", "characterSet": "", "collation": "", @@ -3555,7 +3569,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "role_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3577,11 +3591,11 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "menu_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3603,7 +3617,7 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "menu_id" }, { "objectType": "TableField_MYSQL", @@ -3709,8 +3723,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_role_dept", - "comment": "角色的自定义数据权限范围(部门)", + "name": "pac_auth_link_user_dept", + "comment": "用户部门关联", "engine": "", "characterSet": "", "collation": "", @@ -3785,7 +3799,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "user_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3807,7 +3821,7 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", @@ -3919,7 +3933,15 @@ "primaryKey": { "objectType": "PrimaryKey_MYSQL", "name": "", - "fields": [], + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": -2147483648, + "order": "", + "oldName": "" + } + ], "oldName": "", "indexMethod": "", "comment": "" @@ -3931,8 +3953,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_role_menu", - "comment": "角色菜单关联", + "name": "pac_auth_dept", + "comment": "系统组织架构", "engine": "", "characterSet": "", "collation": "", @@ -4007,7 +4029,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "dept_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4022,18 +4044,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "组织/部门id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "dept_id" }, { "objectType": "TableField_MYSQL", - "name": "menu_id", + "name": "pid", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4045,24 +4067,50 @@ "collation": "", "isNullable": false, "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "父id", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "pid" + }, + { + "objectType": "TableField_MYSQL", + "name": "grade", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "部门等级,下级部门自动+1", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_id" + "oldName": "grade" }, { "objectType": "TableField_MYSQL", - "name": "createby", - "type": "bigint", - "length": 0, - "decimals": 0, + "name": "dept_name", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4074,21 +4122,47 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "部门名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "dept_name" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "dept_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": "dept_desc" + }, + { + "objectType": "TableField_MYSQL", + "name": "dept_type", + "type": "bigint", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4097,124 +4171,154 @@ "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": "bigint", + "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": "createtime" - } - ], - "indexes": [ + "oldName": "dept_leader" + }, { - "objectType": "Index_MYSQL", - "name": "pac_index", - "type": "UNIQUE", - "method": "", + "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": "", - "oldName": "", - "online": false, - "keyBlockSize": 0, - "parser": "", - "algorithm": "", - "lock": "", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "have_children" + }, + { + "objectType": "TableField_MYSQL", + "name": "order_num", + "type": "int", + "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": [ - { - "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": [ + "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", - "name": "index", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4225,22 +4329,22 @@ "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": true, - "comment": "数据完整性确认", + "isAutoInc": false, + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "index" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "user_id", - "type": "bigint", - "length": -2147483648, - "decimals": -2147483648, + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4252,44 +4356,70 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "createtime" }, { "objectType": "TableField_MYSQL", - "name": "dept_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": "dept_id" + "oldName": "updateby" }, { "objectType": "TableField_MYSQL", - "name": "createby", + "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, @@ -4299,23 +4429,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, @@ -4325,19 +4455,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": [ @@ -4374,7 +4504,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "index", + "name": "dept_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -4391,8 +4521,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_dept", - "comment": "系统组织架构", + "name": "pac_auth_user", + "comment": "用户表", "engine": "", "characterSet": "", "collation": "", @@ -4467,7 +4597,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "dept_id", + "name": "user_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4482,20 +4612,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "组织/部门id", + "comment": "用户id,可采用雪花id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_id" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "pid", - "type": "bigint", - "length": -2147483648, + "name": "username", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -4505,23 +4635,23 @@ "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": "username" }, { "objectType": "TableField_MYSQL", - "name": "grade", - "type": "int", - "length": -2147483648, + "name": "password", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -4534,18 +4664,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门等级,下级部门自动+1", + "comment": "密码", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "grade" + "oldName": "password" }, { "objectType": "TableField_MYSQL", - "name": "dept_name", + "name": "nickname", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -4560,18 +4690,44 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门名称", + "comment": "昵称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_name" + "oldName": "nickname" }, { "objectType": "TableField_MYSQL", - "name": "dept_desc", + "name": "user_type", + "type": "bigint", + "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": "user_type" + }, + { + "objectType": "TableField_MYSQL", + "name": "user_email", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -4586,18 +4742,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门描述", + "comment": "邮箱", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_desc" + "oldName": "user_email" }, { "objectType": "TableField_MYSQL", - "name": "dept_type", + "name": "pid", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4612,20 +4768,20 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门类型", + "comment": "父账户,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_type" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "dept_leader", - "type": "bigint", - "length": -2147483648, + "name": "wx_appid", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -4638,20 +4794,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门负责人,默认可以没有", + "comment": "微信id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_leader" + "oldName": "wx_appid" }, { "objectType": "TableField_MYSQL", - "name": "default_role", - "type": "bigint", - "length": -2147483648, + "name": "avatar", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -4664,20 +4820,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认角色,默认可以没有", + "comment": "图标", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "default_role" + "oldName": "avatar" }, { "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", - "length": -2147483648, + "name": "user_phone", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -4685,23 +4841,49 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "电话", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" + "oldName": "user_phone" }, { "objectType": "TableField_MYSQL", - "name": "order_num", + "name": "user_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": "user_desc" + }, + { + "objectType": "TableField_MYSQL", + "name": "status", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -4716,18 +4898,18 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序,默认0", + "comment": "状态:0默认正常,1禁用,2临时锁定", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "status" }, { "objectType": "TableField_MYSQL", - "name": "status", + "name": "have_children", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -4742,14 +4924,14 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:默认0启用,1禁用", + "comment": "存在子账户:默认0,不存在", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", @@ -4790,7 +4972,7 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Others", + "defaultType": "None", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, @@ -4911,7 +5093,33 @@ "indexes": [ { "objectType": "Index_MYSQL", - "name": "pac_index", + "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": "" + } + ] + }, + { + "objectType": "Index_MYSQL", + "name": "username", "type": "UNIQUE", "method": "", "comment": "", @@ -4928,7 +5136,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "index", + "name": "username", "keyLength": 0, "order": "", "oldName": "" @@ -4942,7 +5150,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "dept_id", + "name": "user_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -4959,8 +5167,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_user", - "comment": "用户表", + "name": "pac_auth_post", + "comment": "岗位", "engine": "", "characterSet": "", "collation": "", @@ -5024,7 +5232,7 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": true, - "comment": "数据完整性确认", + "comment": "数据完整性验证", "columnFormat": "", "storage": "", "isVirtual": false, @@ -5035,7 +5243,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "post_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -5050,70 +5258,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户id,可采用雪花id", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "user_id" - }, - { - "objectType": "TableField_MYSQL", - "name": "username", - "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": "username" - }, - { - "objectType": "TableField_MYSQL", - "name": "password", - "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": "密码", + "comment": "岗位id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "password" + "oldName": "post_id" }, { "objectType": "TableField_MYSQL", - "name": "nickname", + "name": "post_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -5128,44 +5284,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "昵称", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "nickname" - }, - { - "objectType": "TableField_MYSQL", - "name": "user_type", - "type": "bigint", - "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", + "comment": "岗位标识", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_type" + "oldName": "post_key" }, { "objectType": "TableField_MYSQL", - "name": "user_email", + "name": "post_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -5180,18 +5310,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "邮箱", + "comment": "岗位名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_email" + "oldName": "post_name" }, { "objectType": "TableField_MYSQL", - "name": "pid", + "name": "post_type", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -5203,99 +5333,21 @@ "collation": "", "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": false, - "comment": "电话", + "comment": "岗位类型", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_phone" + "oldName": "post_type" }, { "objectType": "TableField_MYSQL", - "name": "user_desc", + "name": "post_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -5310,18 +5362,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户描述", + "comment": "岗位描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_desc" + "oldName": "post_desc" }, { "objectType": "TableField_MYSQL", - "name": "status", + "name": "order_num", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -5336,18 +5388,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, @@ -5362,14 +5414,14 @@ "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", @@ -5410,7 +5462,7 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "None", + "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, @@ -5554,32 +5606,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": { @@ -5588,8 +5614,8 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "user_id", - "keyLength": -2147483648, + "name": "post_id", + "keyLength": 0, "order": "", "oldName": "" } @@ -5709,7 +5735,7 @@ "x": 860, "y": 1130, "width": 272, - "height": 330, + "height": 350, "isBold": false, "titleColor": { "r": 55, diff --git a/src/application/app.module.ts b/src/application/app.module.ts index 67d796d..054044a 100644 --- a/src/application/app.module.ts +++ b/src/application/app.module.ts @@ -16,6 +16,8 @@ import { CoreEnvModule } from './core-env/core-env.module'; import { CoreMenuModule } from './core-menu/core-menu.module'; import { AuthRoleModule } from './auth-role/auth-role.module'; import { AuthDeptModule } from './auth-dept/auth-dept.module'; +import { AuthPostModule } from './auth-post/auth-post.module'; +import { AuthUserModule } from './auth-user/auth-user.module'; @Module({ imports: [ @@ -31,6 +33,8 @@ import { AuthDeptModule } from './auth-dept/auth-dept.module'; CoreMenuModule, AuthRoleModule, AuthDeptModule, + AuthPostModule, + AuthUserModule, ], controllers: [AppController], providers: [ diff --git a/src/application/auth-dept/auth-dept.controller.ts b/src/application/auth-dept/auth-dept.controller.ts index 07ed7eb..0f54d6e 100644 --- a/src/application/auth-dept/auth-dept.controller.ts +++ b/src/application/auth-dept/auth-dept.controller.ts @@ -6,10 +6,8 @@ import { ApiOperation, ApiProduces, ApiTags } from '@nestjs/swagger'; import { PacInfo } from '@common/decorator/pac-info/pac-info.decorator'; import { PacInfoType } from '@utils/myType'; import { GetAuthDeptDto } from '@app/auth-dept/dto/get-auth-dept.dto'; -import { - GetUserForAttDto -} from "@dto/GetUserForAtt.dto"; -import {DeptLinkUserDto} from "@dto/AttLinkUser.dto"; +import { GetUserForAttDto } from '@dto/GetUserForAtt.dto'; +import { DeptLinkUserDto } from '@dto/AttLinkUser.dto'; @ApiTags('部门服务') @Controller('authDept') @@ -82,7 +80,7 @@ export class AuthDeptController { }) @ApiProduces('application/json') @Get('/user/:pid') - findUser(@Param('pid') pid: string,@Query() getUserForAttDto: GetUserForAttDto) { + findUser(@Param('pid') pid: string, @Query() getUserForAttDto: GetUserForAttDto) { return this.authDeptService.findUser(pid, getUserForAttDto); } diff --git a/src/application/auth-dept/auth-dept.service.ts b/src/application/auth-dept/auth-dept.service.ts index 31a43c7..3ce83ec 100644 --- a/src/application/auth-dept/auth-dept.service.ts +++ b/src/application/auth-dept/auth-dept.service.ts @@ -15,9 +15,7 @@ import { likeQuery } from '@utils/likeQuery'; import { alias, QueryBuilder } from 'drizzle-orm/mysql-core'; import { customDrizzleRowWithRecursive } from '@utils/customDrizzleRowWithRecursive'; import { GetUserForAttDto } from '@dto/GetUserForAtt.dto'; -import { - DeptLinkUserDto -} from "@dto/AttLinkUser.dto"; +import { DeptLinkUserDto } from '@dto/AttLinkUser.dto'; @Injectable() export class AuthDeptService { @@ -154,7 +152,40 @@ export class AuthDeptService { * DATE: 2024-06-28 11:30:50 - * */ public async update(id: string, updateAuthDeptDto: UpdateAuthDeptDto, pacInfo: PacInfoType) { - return this.updateDept(id, updateAuthDeptDto, pacInfo.userId); + // ! 获取部门信息 + const dept = await this.getDeptForDeptId(id); + + // ? 不存在部门? + if (dept.length > 0) throw new HttpException('未找到目标部门信息,无法修改!', HttpStatus.BAD_REQUEST); + + const pid = dept[0].pid; + + // ! 加目标锁,同级,而不是全局 + const lock = await this.redisService.distributedLock('DEPT' + updateAuthDeptDto.pid + '-' + updateAuthDeptDto.deptName, updateAuthDeptDto.deptName); + + // ? 存在正在进行写入的部门 + if (!lock) throw new HttpException('服务繁忙,部门名称重复!', HttpStatus.CONFLICT); + + + try { + // ! 同级查重 + const result = await this.checkRepeatForDeptName(updateAuthDeptDto.deptName, updateAuthDeptDto.pid); + + // ? 是否存在重复的部门 + if (result.length > 0 && result[0].id != id) throw new HttpException('部门名称重复!', HttpStatus.CONFLICT); + + // ! 解锁 + lock(); + + // ! 返回结果 + return await this.updateDept(id, updateAuthDeptDto, pacInfo.userId); + } catch (e) { + // ! 解锁 + lock(); + + // ! 抛出错误 + throw e; + } } /** Service @@ -196,7 +227,9 @@ export class AuthDeptService { // DB 同级查重 private checkRepeatForDeptName(deptName: string, pid: string) { return this.mysqlService.db - .select() + .select({ + id: pacAuthDept.deptId, + }) .from(pacAuthDept) .where(and(isNull(pacAuthDept.deleteby), eq(pacAuthDept.pid, pid), eq(pacAuthDept.deptName, deptName))); } @@ -320,8 +353,6 @@ export class AuthDeptService { // DB 查树 private getRoleTree(pid: string = '0') { - console.log(pid); - // ! 基础层级 const baseQueryBuilder = new QueryBuilder(); const baseQuery = baseQueryBuilder @@ -468,7 +499,6 @@ export class AuthDeptService { // DB 查找部门下的账户 private async getDeptUser(deptId: string, getUserForAttDto: GetUserForAttDto) { - console.log(getUserForAttDto); const offset = (getUserForAttDto.pageNumber - 1) * getUserForAttDto.pageSize; // ! 使用基础查询构建查询总记录数 diff --git a/src/application/auth-dept/dto/get-auth-dept.dto.ts b/src/application/auth-dept/dto/get-auth-dept.dto.ts index eb1aec0..6ffb5b8 100644 --- a/src/application/auth-dept/dto/get-auth-dept.dto.ts +++ b/src/application/auth-dept/dto/get-auth-dept.dto.ts @@ -20,7 +20,7 @@ import Int from '@common/decorator/int/int.descrator'; export class GetAuthDeptDto extends GetDto { @ApiProperty({ - description: '角色', + description: '部门', type: String, example: '管理员', required: false, @@ -28,13 +28,13 @@ export class GetAuthDeptDto extends GetDto { maxLength: 128, }) @Trim() - @IsString({ message: '角色信息应为字符串格式!' }) - @Length(0, 128, { message: '请将角色信息长度控制在1到128位之间!' }) + @IsString({ message: '部门信息应为字符串格式!' }) + @Length(0, 128, { message: '请将部门信息长度控制在1到128位之间!' }) @IsOptional() readonly deptInfo?: string; @ApiProperty({ - description: '角色类型,来自于字典', + description: '部门类型,来自于字典', type: String, example: '0', required: false, @@ -42,13 +42,13 @@ export class GetAuthDeptDto extends GetDto { maxLength: 19, }) @Trim() - @IsString({ message: '角色类型格式不正确!' }) - @Length(19, 19, { message: '角色类型格式不正确!' }) + @IsString({ message: '部门类型格式不正确!' }) + @Length(19, 19, { message: '部门类型格式不正确!' }) @IsOptional() readonly deptType: string; @ApiProperty({ - description: '角色状态', + description: '部门状态', type: Number, example: 0, required: false, @@ -58,19 +58,19 @@ export class GetAuthDeptDto 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, @@ -78,8 +78,8 @@ export class GetAuthDeptDto 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; } diff --git a/src/application/auth-post/auth-post.controller.ts b/src/application/auth-post/auth-post.controller.ts new file mode 100644 index 0000000..428df55 --- /dev/null +++ b/src/application/auth-post/auth-post.controller.ts @@ -0,0 +1,65 @@ +import {Controller, Get, Post, Body, Patch, Param, Delete, Query} from '@nestjs/common'; +import { AuthPostService } from './auth-post.service'; +import { CreateAuthPostDto } from './dto/create-auth-post.dto'; +import { UpdateAuthPostDto } from './dto/update-auth-post.dto'; +import { ApiOperation, ApiProduces, ApiTags } from '@nestjs/swagger'; +import { PacInfo } from '@common/decorator/pac-info/pac-info.decorator'; +import { PacInfoType } from '@utils/myType'; +import {GetAuthPostDto} from "@app/auth-post/dto/get-auth-post.dto"; + +@ApiTags('岗位服务') +@Controller('authPost') +export class AuthPostController { + constructor(private readonly authPostService: AuthPostService) {} + + @ApiOperation({ + summary: '添加岗位', + description: '岗位', + }) + @ApiProduces('application/json') + @Post() + @Post() + create(@Body() createAuthPostDto: CreateAuthPostDto, @PacInfo() pacInfo: PacInfoType) { + return this.authPostService.create(createAuthPostDto, pacInfo); + } + + @ApiOperation({ + summary: '获取岗位列表', + description: '查询岗位分页或者列表', + }) + @ApiProduces('application/json') + @Get() + findAll(@Query() getAuthPostDto: GetAuthPostDto) { + return this.authPostService.findAll(getAuthPostDto); + } + + @ApiOperation({ + summary: '获取岗位详细信息', + description: '查询岗位详细信息,目录菜单列表,数据权限范围', + }) + @ApiProduces('application/json') + @Get(':id') + findOne(@Param('id') id: string) { + return this.authPostService.findOne(id); + } + + @ApiOperation({ + summary: '更新岗位信息', + description: '更新岗位信息', + }) + @ApiProduces('application/json') + @Patch(':id') + update(@Param('id') id: string, @Body() updateAuthPostDto: UpdateAuthPostDto, @PacInfo() pacInfo: PacInfoType) { + return this.authPostService.update(id, updateAuthPostDto, pacInfo); + } + + @ApiOperation({ + summary: '删除目标岗位', + description: '删除目标岗位信息', + }) + @ApiProduces('application/json') + @Delete(':id') + remove(@Param('id') id: string, @PacInfo() pacInfo: PacInfoType) { + return this.authPostService.remove(id, pacInfo); + } +} diff --git a/src/application/auth-post/auth-post.module.ts b/src/application/auth-post/auth-post.module.ts new file mode 100644 index 0000000..8a33633 --- /dev/null +++ b/src/application/auth-post/auth-post.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { AuthPostService } from './auth-post.service'; +import { AuthPostController } from './auth-post.controller'; + +@Module({ + controllers: [AuthPostController], + providers: [AuthPostService], +}) +export class AuthPostModule {} diff --git a/src/application/auth-post/auth-post.service.ts b/src/application/auth-post/auth-post.service.ts new file mode 100644 index 0000000..3804a29 --- /dev/null +++ b/src/application/auth-post/auth-post.service.ts @@ -0,0 +1,301 @@ +import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; +import { CreateAuthPostDto } from './dto/create-auth-post.dto'; +import { UpdateAuthPostDto } from './dto/update-auth-post.dto'; +import { LoggerService } from '@service/logger/logger.service'; +import { MysqlService } from '@common/service/mysql/mysql.service'; +import { RedisService } from '@common/service/redis/redis.service'; +import { Snowflake } from '@service/snowflake/snowflake.service'; +import { ConfigService } from '@nestjs/config'; +import {pacAuthDept, pacAuthPost, pacAuthUser, pacCoreDict} from '@entities/schema'; +import { and, asc, desc, eq, isNull, like, or, sql } from 'drizzle-orm'; +import { PacInfoType } from '@utils/myType'; +import { isExistKey, isTrueEnum } from '@utils/boolean.enum'; +import { GetAuthPostDto } from '@app/auth-post/dto/get-auth-post.dto'; +import { likeQuery } from '@utils/likeQuery'; +import { alias } from 'drizzle-orm/mysql-core'; + +@Injectable() +export class AuthPostService { + // 分页数据格式 + private readonly postPageType = { + postId: pacAuthPost.postId, + postKey: pacAuthPost.postKey, + postName: pacAuthPost.postName, + postType: pacAuthPost.postType, + postTypeName: pacCoreDict.dictName, + postTypeKey: pacCoreDict.dictKey, + postDesc: pacAuthPost.postDesc, + orderNum: pacAuthPost.orderNum, + status: pacAuthPost.status, + createby: pacAuthPost.createby, + createtime: pacAuthPost.createtime, + updateby: pacAuthPost.updateby, + updatetime: pacAuthPost.updatetime, + }; + + // 列表数据格式 + private readonly postListType = { + postId: pacAuthPost.postId, + postKey: pacAuthPost.postKey, + postName: pacAuthPost.postName, + postType: pacAuthPost.postType, + postTypeName: pacCoreDict.dictName, + postTypeKey: pacCoreDict.dictKey, + orderNum: pacAuthPost.orderNum, + }; + constructor( + private readonly logger: LoggerService, + private readonly mysqlService: MysqlService, + private readonly redisService: RedisService, + private readonly snowflake: Snowflake, + private readonly config: ConfigService, + ) {} + + /** Service + * NAME: create + * DESC: 创建岗位信息 + * DATE: 2024-06-29 13:13:44 - + * */ + public async create(createAuthPostDto: CreateAuthPostDto, pacInfo: PacInfoType) { + // ! 加目标锁,同级,而不是全局 + const lock = await this.redisService.distributedLock('POST' + createAuthPostDto.postKey, createAuthPostDto.postKey); + + // ? 存在正在进行写入的岗位 + if (!lock) throw new HttpException('服务繁忙,岗位名称重复!', HttpStatus.CONFLICT); + + // @ 核心逻辑 + + try { + // ! 查重 + const result = await this.checkRepeatForPostKey(createAuthPostDto.postKey); + + // ? 是否存在重复的岗位 + if (result.length > 0) throw new HttpException('岗位标识重复!', HttpStatus.CONFLICT); + + // ! 添加岗位数据 + const newPacCoreDict = await this.addPost(createAuthPostDto, pacInfo.userId as any); + + // ! 解锁 + lock(); + + // ! 返回结果 + return newPacCoreDict; + } catch (e) { + // ! 解锁 + lock(); + + // ! 抛出错误 + throw e; + } + } + + /** Service + * NAME: findAll + * DESC: 获取岗位分页/列表 + * DATE: 2024-06-29 13:13:47 - + * */ + public async findAll(getAuthPostDto: GetAuthPostDto) { + if (isTrueEnum(getAuthPostDto['isList'])) { + return await this.getList(getAuthPostDto); + } else { + return await this.getPage(getAuthPostDto); + } + } + + /** Service + * NAME: findOne + * DESC: 获取岗位详细信息 + * DATE: 2024-06-29 13:13:49 - + * */ + public findOne(id: string) { + return `This action returns a #${id} authPost`; + } + + /** Service + * NAME: update + * DESC: 更新岗位信息 + * DATE: 2024-06-29 13:13:52 - + * */ + public async update(id: string, updateAuthPostDto: UpdateAuthPostDto, pacInfo: PacInfoType) { + return await this.updatePost(id, updateAuthPostDto, pacInfo.userId as any); + } + + /** Service + * NAME: remove + * DESC: 删除岗位信息 + * DATE: 2024-06-29 13:13:55 - + * */ + public remove(id: string, pacInfo: PacInfoType) { + return this.deletePost(id, pacInfo.userId as any); + } + + // DB 查重Key + private checkRepeatForPostKey(postKey) { + return this.mysqlService.db + .select({ id: pacAuthPost.postId }) + .from(pacAuthPost) + .where(and(isNull(pacAuthPost.deleteby), eq(pacAuthPost.postKey, postKey))); + } + + // DB 写入岗位信息 + private async addPost(createAuthPostDto: CreateAuthPostDto, userId: string) { + // ! 生成雪花id,用于岗位主键 + const id = await this.snowflake.generate(); + + // ! 定义写入的岗位数据 + const newPostData: typeof pacAuthPost.$inferInsert = { + postId: id as any, + postKey: createAuthPostDto.postKey, + postName: createAuthPostDto.postName, + postType: createAuthPostDto.postType, + postDesc: createAuthPostDto.postDesc, + orderNum: createAuthPostDto.orderNum, + createby: userId, + createtime: sql`now()` as any, + }; + return await this.mysqlService.db.insert(pacAuthPost).values(newPostData); + } + + // DB 查询构建器 + private queryBuilder(getAuthPostDto: GetAuthPostDto, selectData) { + // ! 定义基础查询函数 + // 启用动态查询模式 $dynamic + const query = this.mysqlService.db + .select(selectData) + .from(pacAuthPost) + .orderBy( + isTrueEnum(getAuthPostDto.isAsc) ? asc(pacAuthPost.orderNum) : desc(pacAuthPost.orderNum), + isTrueEnum(getAuthPostDto.isAsc) ? asc(pacAuthPost.postId) : desc(pacAuthPost.postId), + ) + .leftJoin(pacCoreDict, eq(pacAuthPost.postType, pacCoreDict.dictId)) + .$dynamic(); + + // 查询条件集合 + const wl = []; + + // ? 未删除 + wl.push(isNull(pacAuthPost.deleteby)); + + // ? 模糊查询 + wl.push( + or( + like(pacAuthPost.postName, likeQuery(getAuthPostDto.postInfo)), + like(pacAuthPost.postKey, likeQuery(getAuthPostDto.postInfo)), + like(pacAuthPost.postDesc, likeQuery(getAuthPostDto.postInfo)), + ).if(isExistKey(pacAuthPost, 'postInfo')), + ); + + // ? 按照层级查 + + // ? 是否查岗位类型 + wl.push(eq(pacAuthPost.postType, getAuthPostDto.postType).if(isExistKey(getAuthPostDto, 'postType'))); + + // ? 是否查字典状态 + wl.push(eq(pacAuthPost.status, getAuthPostDto.status as any).if(isExistKey(getAuthPostDto, 'status'))); + + query.where(and(...wl)); + return query; + } + + // DB 查分页 + private async getPage(getAuthPostDto: GetAuthPostDto) { + const offset = (getAuthPostDto.pageNumber - 1) * getAuthPostDto.pageSize; + + // ! 使用基础查询构建查询总记录数 + const totalCountQuery = this.queryBuilder(getAuthPostDto, { + totalCount: sql`COUNT(*)`, + }); + + // ! 使用基础查询构建分页查询 + // 重命名表 + const userTable1 = alias(pacAuthUser, 'userTable1'); + const userTable2 = alias(pacAuthUser, 'userTable2'); + const paginatedQuery = this.queryBuilder(getAuthPostDto, { + ...this.postPageType, + updateName: userTable1.nickname, + createName: userTable2.nickname, + }) + .leftJoin(userTable2, eq(pacAuthPost.createby, userTable2.userId)) + .leftJoin(userTable1, eq(pacAuthPost.updateby, userTable1.userId)) + .limit(getAuthPostDto.pageSize) + .offset(offset); + + return { + total: (await totalCountQuery)[0].totalCount, + rowData: await paginatedQuery, + searchData: getAuthPostDto, + }; + } + + // DB 查列表 + private getList(getAuthPostDto: GetAuthPostDto) { + return this.queryBuilder(getAuthPostDto, this.postListType); + } + + // DB 删除岗位 + private deletePost(id: string, userId: string) { + // ! 删除岗位数据 + return this.mysqlService.db + .update(pacAuthPost) + .set({ + deletetime: sql`now()`, + deleteby: userId, + }) + .where(eq(pacAuthPost.postId, id)); + } + + // DB 更新岗位 + private async updatePost(id: string, updateAuthPostDto: UpdateAuthPostDto, userId: string) { + // ! 查岗位 + const post = await this.mysqlService.db + .select() + .from(pacAuthPost) + .where(and(isNull(pacAuthPost.deleteby), eq(pacAuthPost.postId, id))); + + if (post.length === 0) throw new HttpException('未找到目标岗位信息,无法修改!', HttpStatus.BAD_REQUEST); + + // ! 加目标锁,同级,而不是全局 + const lock = await this.redisService.distributedLock('POST' + updateAuthPostDto.postKey, updateAuthPostDto.postKey); + + // ? 存在正在进行写入的岗位 + if (!lock) throw new HttpException('服务繁忙,岗位标识重复!', HttpStatus.CONFLICT); + + // @ 核心逻辑 + + try { + // ! 查重 + const result = await this.checkRepeatForPostKey(updateAuthPostDto.postKey); + + + // ? 是否存在重复的岗位 + if (result.length > 0 && result[0].id != id) throw new HttpException('岗位标识重复!', HttpStatus.CONFLICT); + + // ! 添加岗位数据 + const newPacCoreDict = await this.mysqlService.db + .update(pacAuthPost) + .set({ + postKey: updateAuthPostDto.postKey, + postName: updateAuthPostDto.postName, + postType: updateAuthPostDto.postType, + postDesc: updateAuthPostDto.postDesc, + orderNum: updateAuthPostDto.orderNum, + status: updateAuthPostDto.status, + updateby: userId, + updatetime: sql`now()`, + }) + .where(eq(pacAuthPost.postId, id)); + + // ! 解锁 + lock(); + + // ! 返回结果 + return newPacCoreDict; + } catch (e) { + // ! 解锁 + lock(); + + // ! 抛出错误 + throw e; + } + } +} diff --git a/src/application/auth-post/dto/create-auth-post.dto.ts b/src/application/auth-post/dto/create-auth-post.dto.ts new file mode 100644 index 0000000..b71b9c7 --- /dev/null +++ b/src/application/auth-post/dto/create-auth-post.dto.ts @@ -0,0 +1,80 @@ +import { ApiProperty } from '@nestjs/swagger'; +import Trim from '@common/decorator/trim/trim.decorator'; +import ChangeCase, { CaseType } from '@common/decorator/change-case/change-case.decorator'; +import { IsInt, IsOptional, IsString, Length, Max, Min } from 'class-validator'; + +export class CreateAuthPostDto { + @ApiProperty({ + description: '岗位标志', + type: String, + example: 'Country', + required: true, + minLength: 1, + maxLength: 32, + }) + @Trim() + @ChangeCase(CaseType.constant) + @IsString({ message: '岗位标志应为字符串格式!' }) + @Length(1, 32, { message: '请将岗位标志长度控制在1到32位之间!' }) + readonly postKey: string; + + @ApiProperty({ + description: '岗位名称', + type: String, + example: '研发经理', + required: true, + minLength: 1, + maxLength: 32, + }) + @Trim() + @IsString({ message: '岗位名称应为字符串格式!' }) + @Length(1, 32, { message: '岗位名称长度控制在1到32位之间!' }) + readonly postName: string; + + @ApiProperty({ + description: '岗位类型,来自于字典', + type: String, + example: '0', + required: true, + minLength: 19, + maxLength: 19, + }) + @Trim() + @IsString({ message: '岗位类型格式不正确!' }) + @Length(19, 19, { message: '岗位类型格式不正确!' }) + readonly postType: string; + + @ApiProperty({ + description: '岗位描述', + type: String, + example: '0', + required: false, + minLength: 1, + maxLength: 255, + }) + @Trim() + @IsString({ message: '岗位描述应为字符串格式!' }) + @Length(1, 255, { message: '请将岗位描述长度控制在1到255位之间!' }) + @IsOptional() + readonly postDesc: string; + + @ApiProperty({ + description: '排序', + type: Number, + example: 10, + required: false, + minimum: -1000, + maximum: 1000, + }) + @IsOptional() + @IsInt({ + message: '排序必须是整数!', + }) + @Min(-1000, { + message: '排序不能小于-1000!', + }) + @Max(1000, { + message: '排序不能超过1000', + }) + readonly orderNum?: number = 0; +} diff --git a/src/application/auth-post/dto/get-auth-post.dto.ts b/src/application/auth-post/dto/get-auth-post.dto.ts new file mode 100644 index 0000000..bd69ae9 --- /dev/null +++ b/src/application/auth-post/dto/get-auth-post.dto.ts @@ -0,0 +1,70 @@ +// | ------------------------------------------------------------ +// | @版本: version 0.1 +// | @创建人: 【Nie-x7129】 +// | @E-mail: x71291@outlook.com +// | @所在项目: pac-auth +// | @文件描述: get-auth-dept.dto.ts - +// | @创建时间: 2024-06-28 11:20 +// | @更新时间: 2024-06-28 11:20 +// | @修改记录: +// | -*-*-*- (时间--修改人--修改说明) -*-*-*- +// | = +// | ------------------------------------------------------------ + +import { GetDto } from '@dto/get.dto'; +import { ApiProperty } from '@nestjs/swagger'; +import Trim from '@common/decorator/trim/trim.decorator'; +import { IsInt, IsOptional, IsString, Length, Max, Min } from 'class-validator'; +import Int from '@common/decorator/int/int.descrator'; + +export class GetAuthPostDto extends GetDto { + @ApiProperty({ + description: '岗位', + type: String, + example: '管理员', + required: false, + minLength: 1, + maxLength: 128, + }) + @Trim() + @IsString({ message: '岗位信息应为字符串格式!' }) + @Length(0, 128, { message: '请将岗位信息长度控制在1到128位之间!' }) + @IsOptional() + readonly postInfo?: string; + + @ApiProperty({ + description: '岗位类型,来自于字典', + type: String, + example: '0', + required: false, + minLength: 19, + maxLength: 19, + }) + @Trim() + @IsString({ message: '岗位类型格式不正确!' }) + @Length(19, 19, { message: '岗位类型格式不正确!' }) + @IsOptional() + readonly postType: string; + + @ApiProperty({ + description: '岗位状态', + type: Number, + example: 0, + required: false, + minimum: -100, + maximum: 100, + }) + @Trim() + @Int() + @IsInt({ + message: '岗位状态必须是整数!', + }) + @Min(-100, { + message: '岗位状态需要大于-100!', + }) + @Max(100, { + message: '岗位状态不能超过100', + }) + @IsOptional() + readonly status?: string; +} diff --git a/src/application/auth-post/dto/update-auth-post.dto.ts b/src/application/auth-post/dto/update-auth-post.dto.ts new file mode 100644 index 0000000..6548934 --- /dev/null +++ b/src/application/auth-post/dto/update-auth-post.dto.ts @@ -0,0 +1,25 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger'; +import { CreateAuthPostDto } from './create-auth-post.dto'; +import { IsInt, IsOptional, Max, Min } from 'class-validator'; + +export class UpdateAuthPostDto extends PartialType(CreateAuthPostDto) { + @ApiProperty({ + description: '状态', + type: Number, + example: 10, + required: false, + minimum: -100, + maximum: 100, + }) + @IsOptional() + @IsInt({ + message: '状态必须是整数!', + }) + @Min(-1000, { + message: '状态不能小于-100!', + }) + @Max(1000, { + message: '状态不能超过100', + }) + readonly status: number; +} diff --git a/src/application/auth-post/entities/auth-post.entity.ts b/src/application/auth-post/entities/auth-post.entity.ts new file mode 100644 index 0000000..bf0b1d5 --- /dev/null +++ b/src/application/auth-post/entities/auth-post.entity.ts @@ -0,0 +1 @@ +export class AuthPost {} diff --git a/src/application/auth-role/auth-role.service.ts b/src/application/auth-role/auth-role.service.ts index 3a73f0a..244703f 100644 --- a/src/application/auth-role/auth-role.service.ts +++ b/src/application/auth-role/auth-role.service.ts @@ -24,7 +24,7 @@ import { GetUserForAttDto } from '@dto/GetUserForAtt.dto'; import { likeQuery } from '@utils/likeQuery'; import { alias, QueryBuilder } from 'drizzle-orm/mysql-core'; import { customDrizzleRowWithRecursive } from '@utils/customDrizzleRowWithRecursive'; -import {RoleLinkUserDto} from "@dto/AttLinkUser.dto"; +import { RoleLinkUserDto } from '@dto/AttLinkUser.dto'; @Injectable() export class AuthRoleService { @@ -198,7 +198,7 @@ export class AuthRoleService { const checkRepeat = await this.getRoleForRoleKey(updateAuthRoleDto.roleKey); // ? 是否存在重复的角色 - if (checkRepeat.length > 0 && checkRepeat[0].roleId != roleId) throw new HttpException('角色标识重复!', HttpStatus.CONFLICT); + if (checkRepeat.length > 0 && checkRepeat[0].id != roleId) throw new HttpException('角色标识重复!', HttpStatus.CONFLICT); // ! 修改角色数据 const result = await this.updateRole(roleId, updateAuthRoleDto, pacInfo.userId as any).catch((e) => { @@ -262,7 +262,7 @@ export class AuthRoleService { // DB 通过roleKey查找角色信息 private getRoleForRoleKey(key: string) { return this.mysqlService.db - .select() + .select({ id: pacAuthRole.roleId }) .from(pacAuthRole) .where(and(isNull(pacAuthRole.deleteby), eq(pacAuthRole.roleKey, key))); } 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 e1339ad..7f3ffc4 100644 --- a/src/application/auth-role/dto/create-auth-role.dto.ts +++ b/src/application/auth-role/dto/create-auth-role.dto.ts @@ -49,14 +49,13 @@ export class CreateAuthRoleDto { description: '角色类型,来自于字典', type: String, example: '0', - required: false, + required: true, minLength: 19, maxLength: 19, }) @Trim() @IsString({ message: '角色类型格式不正确!' }) @Length(19, 19, { message: '角色类型格式不正确!' }) - @IsOptional() readonly roleType: string; @ApiProperty({ diff --git a/src/application/auth-user/auth-user.controller.ts b/src/application/auth-user/auth-user.controller.ts new file mode 100644 index 0000000..b4b5a63 --- /dev/null +++ b/src/application/auth-user/auth-user.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { AuthUserService } from './auth-user.service'; +import { CreateAuthUserDto } from './dto/create-auth-user.dto'; +import { UpdateAuthUserDto } from './dto/update-auth-user.dto'; + +@Controller('auth-user') +export class AuthUserController { + constructor(private readonly authUserService: AuthUserService) {} + + @Post() + create(@Body() createAuthUserDto: CreateAuthUserDto) { + return this.authUserService.create(createAuthUserDto); + } + + @Get() + findAll() { + return this.authUserService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.authUserService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateAuthUserDto: UpdateAuthUserDto) { + return this.authUserService.update(+id, updateAuthUserDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.authUserService.remove(+id); + } +} diff --git a/src/application/auth-user/auth-user.module.ts b/src/application/auth-user/auth-user.module.ts new file mode 100644 index 0000000..f6884bb --- /dev/null +++ b/src/application/auth-user/auth-user.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { AuthUserService } from './auth-user.service'; +import { AuthUserController } from './auth-user.controller'; + +@Module({ + controllers: [AuthUserController], + providers: [AuthUserService], +}) +export class AuthUserModule {} diff --git a/src/application/auth-user/auth-user.service.ts b/src/application/auth-user/auth-user.service.ts new file mode 100644 index 0000000..31151fb --- /dev/null +++ b/src/application/auth-user/auth-user.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateAuthUserDto } from './dto/create-auth-user.dto'; +import { UpdateAuthUserDto } from './dto/update-auth-user.dto'; + +@Injectable() +export class AuthUserService { + create(createAuthUserDto: CreateAuthUserDto) { + return 'This action adds a new authUser'; + } + + findAll() { + return `This action returns all authUser`; + } + + findOne(id: number) { + return `This action returns a #${id} authUser`; + } + + update(id: number, updateAuthUserDto: UpdateAuthUserDto) { + return `This action updates a #${id} authUser`; + } + + remove(id: number) { + return `This action removes a #${id} authUser`; + } +} diff --git a/src/application/auth-user/dto/create-auth-user.dto.ts b/src/application/auth-user/dto/create-auth-user.dto.ts new file mode 100644 index 0000000..7f571be --- /dev/null +++ b/src/application/auth-user/dto/create-auth-user.dto.ts @@ -0,0 +1 @@ +export class CreateAuthUserDto {} diff --git a/src/application/auth-user/dto/update-auth-user.dto.ts b/src/application/auth-user/dto/update-auth-user.dto.ts new file mode 100644 index 0000000..400cb5d --- /dev/null +++ b/src/application/auth-user/dto/update-auth-user.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/swagger'; +import { CreateAuthUserDto } from './create-auth-user.dto'; + +export class UpdateAuthUserDto extends PartialType(CreateAuthUserDto) {} diff --git a/src/application/auth-user/entities/auth-user.entity.ts b/src/application/auth-user/entities/auth-user.entity.ts new file mode 100644 index 0000000..336160d --- /dev/null +++ b/src/application/auth-user/entities/auth-user.entity.ts @@ -0,0 +1 @@ +export class AuthUser {} diff --git a/src/application/core-dict/core-dict.service.ts b/src/application/core-dict/core-dict.service.ts index 5ada0fb..5e9e92b 100644 --- a/src/application/core-dict/core-dict.service.ts +++ b/src/application/core-dict/core-dict.service.ts @@ -172,7 +172,7 @@ export class CoreDictService { const checkRepeat = await this.getDictDataForDictKey(updateCoreDictDto.dictKey); // ? 判断是否存在重名的字典,但是不包括自己 - if (checkRepeat.length > 0 && checkRepeat[0].dictId != dictId) { + if (checkRepeat.length > 0 && checkRepeat[0].id != dictId) { throw new HttpException('服务繁忙,字典标识重复!', HttpStatus.CONFLICT); } @@ -232,7 +232,12 @@ export class CoreDictService { // DB 根据serviceKey查找服务数据 可用于查重 private async getDictDataForDictKey(dictKey: string) { - return await this.mysqlService.db.select().from(pacCoreDict).where(eq(pacCoreDict.dictKey, dictKey)); + return await this.mysqlService.db + .select({ + id: pacCoreDict.dictId, + }) + .from(pacCoreDict) + .where(eq(pacCoreDict.dictKey, dictKey)); } // DB 写入Dict数据 diff --git a/src/application/core-env/core-env.service.ts b/src/application/core-env/core-env.service.ts index a7d1bfb..738c163 100644 --- a/src/application/core-env/core-env.service.ts +++ b/src/application/core-env/core-env.service.ts @@ -174,7 +174,7 @@ export class CoreEnvService { const checkRepeat = await this.getEnvForEnvKey(updateCoreEnvDto.envKey); // ? 判断是否存在重名的环境变量,但是不包括自己 - if (checkRepeat.length > 0 && checkRepeat[0].envId != envId) { + if (checkRepeat.length > 0 && checkRepeat[0].id != envId) { throw new HttpException('环境变量标识重复!', HttpStatus.CONFLICT); } @@ -235,7 +235,12 @@ export class CoreEnvService { // DB 通过EnvKey获取env信息,主要用于查重 private getEnvForEnvKey(envKey: string) { - return this.mysqlService.db.select().from(pacCoreEnv).where(eq(pacCoreEnv.envKey, envKey)); + return this.mysqlService.db + .select({ + id: pacCoreEnv.envId, + }) + .from(pacCoreEnv) + .where(eq(pacCoreEnv.envKey, envKey)); } // DB 添加Env数据 diff --git a/src/entities/relations.ts b/src/entities/relations.ts index 34c5368..80768e2 100644 --- a/src/entities/relations.ts +++ b/src/entities/relations.ts @@ -1,2 +1,3 @@ -import { relations } from 'drizzle-orm/relations'; -import {} from './schema'; +import { relations } from "drizzle-orm/relations"; +import { } from "./schema"; + diff --git a/src/entities/schema.ts b/src/entities/schema.ts index e5811f3..a7f1308 100644 --- a/src/entities/schema.ts +++ b/src/entities/schema.ts @@ -3,6 +3,7 @@ import { sql } from 'drizzle-orm'; import { bigintString } from '@entities/customType'; const bigint = bigintString; + export const pacAuthDept = mysqlTable( 'pac_auth_dept', { @@ -121,17 +122,18 @@ export const pacAuthPost = mysqlTable( 'pac_auth_post', { index: int('index').autoincrement().notNull(), - postId: int('post_id').notNull(), + postId: bigint('post_id', { mode: 'number' }).notNull(), postKey: varchar('post_key', { length: 255 }).notNull(), postName: varchar('post_name', { length: 255 }), + postType: bigint('post_type', { mode: 'number' }).notNull(), postDesc: varchar('post_desc', { length: 255 }), 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) => {