From 86498a5c94b87c173cb9e51fc57ed12db0f67a7a Mon Sep 17 00:00:00 2001 From: expressgy Date: Tue, 25 Jun 2024 17:49:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=A7=92=E8=89=B2=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=90=84=E4=B8=AAid=E7=9A=84=E4=B8=93?= =?UTF-8?q?=E6=9C=89DTO=EF=BC=8C=E5=B0=86=E6=89=80=E6=9C=89KEY=E9=83=BD?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/pacAuth_database_0.2.ndm2 | 2486 +++++++---------- src/application/app.module.ts | 2 + .../auth-role/auth-role.controller.ts | 63 + src/application/auth-role/auth-role.module.ts | 9 + .../auth-role/auth-role.service.ts | 208 ++ .../auth-role/dto/create-auth-role.dto.ts | 154 + .../auth-role/dto/get-auth-role.dto.ts | 113 + .../auth-role/dto/update-auth-role.dto.ts | 4 + .../core-dict/dto/create-core-dict.dto.ts | 7 +- .../core-dict/dto/get-core-dict.dto.ts | 10 +- .../core-env/dto/create-core-env.dto.ts | 1 + .../core-env/dto/get-core-env.dto.ts | 5 +- .../core-menu/core-menu.service.ts | 2 +- .../core-menu/dto/create-core-menu.dto.ts | 4 + .../core-menu/dto/get-core-menu.dto.ts | 4 + .../dto/create-core-service.dto.ts | 4 + src/entities/relations.ts | 5 +- src/entities/schema.ts | 56 +- 18 files changed, 1584 insertions(+), 1553 deletions(-) create mode 100644 src/application/auth-role/auth-role.controller.ts create mode 100644 src/application/auth-role/auth-role.module.ts create mode 100644 src/application/auth-role/auth-role.service.ts create mode 100644 src/application/auth-role/dto/create-auth-role.dto.ts create mode 100644 src/application/auth-role/dto/get-auth-role.dto.ts create mode 100644 src/application/auth-role/dto/update-auth-role.dto.ts diff --git a/docs/pacAuth_database_0.2.ndm2 b/docs/pacAuth_database_0.2.ndm2 index 48569bf..767f643 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_link_role_menu", - "comment": "角色菜单关联", + "name": "pac_auth_dept", + "comment": "系统组织架构", "engine": "", "characterSet": "", "collation": "", @@ -433,7 +433,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "dept_id", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -448,18 +448,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": "int", "length": -2147483648, "decimals": -2147483648, @@ -471,24 +471,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "父id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_id" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "createby", + "name": "grade", "type": "int", - "length": 0, - "decimals": 0, + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -500,47 +500,47 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "部门等级,下级部门自动+1", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "grade" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "dept_name", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "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": "createtime" + "oldName": "dept_name" }, { "objectType": "TableField_MYSQL", - "name": "updateby", - "type": "int", - "length": 0, - "decimals": 0, + "name": "dept_desc", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -548,51 +548,51 @@ "charset": "", "collation": "", "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "更新人", + "comment": "部门描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "updateby" + "oldName": "dept_desc" }, { "objectType": "TableField_MYSQL", - "name": "updatetime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "dept_type", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "更新时间", + "comment": "部门类型", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "updatetime" + "oldName": "dept_type" }, { "objectType": "TableField_MYSQL", - "name": "deleteby", + "name": "dept_leader", "type": "int", - "length": 0, - "decimals": 0, + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -600,148 +600,22 @@ "charset": "", "collation": "", "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "删除人", + "comment": "部门负责人,默认可以没有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "deleteby" + "oldName": "dept_leader" }, { "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": "", - "collation": "", - "cardinality": "", - "packed": "", - "IsVisibleIndex": true, - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": 0, - "order": "", - "oldName": "" - } - ] - } - ], - "primaryKey": { - "objectType": "PrimaryKey_MYSQL", - "name": "", - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": -2147483648, - "order": "", - "oldName": "" - } - ], - "oldName": "", - "indexMethod": "", - "comment": "" - }, - "foreignKeys": [], - "checks": [], - "triggers": [], - "tablePartitions": [] - }, - { - "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_role", - "comment": "用户角色关联", - "engine": "", - "characterSet": "", - "collation": "", - "autoIncrement": 0, - "tablespace": "", - "storage": "", - "insertMethod": "", - "connection": "", - "checksum": false, - "rowFormat": "", - "avgRowLength": 0, - "maxRows": 0, - "minRows": 0, - "keyBlockSize": 0, - "packKeys": "", - "delayKeyWrite": false, - "dataDirectory": "", - "indexDirectory": "", - "statsAutoRecalc": "", - "statsPersistent": "", - "statsSamplePages": 0, - "union": "", - "pageCheckSum": false, - "transactional": false, - "compression": "", - "oldName": "", - "encryption": false, - "createOptions": "", - "createTime": "", - "checkTime": "", - "dataFree": 0, - "dataLength": 0, - "indexLength": 0, - "maxDataLength": 0, - "rows": 0, - "updateTime": "", - "DDL": "", - "partitionBy": "", - "partitionByExpr": "", - "partitions": 0, - "partitionKeyAlgorithm": "", - "subPartitionBy": "", - "subPartitionByExpr": "", - "subPartitions": 0, - "subPartitionKeyAlgorithm": "", - "fields": [ - { - "objectType": "TableField_MYSQL", - "name": "index", + "name": "default_role", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -751,23 +625,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": true, - "comment": "数据完整性确认", + "isAutoInc": false, + "comment": "默认角色,默认可以没有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "index" + "oldName": "default_role" }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "order_num", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -779,21 +653,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "排序,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "order_num" }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "status", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -805,17 +679,17 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "状态:默认0启用,1禁用", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "role_id" + "oldName": "status" }, { "objectType": "TableField_MYSQL", @@ -1008,7 +882,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "index", + "name": "dept_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -1025,8 +899,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_post", - "comment": "用户岗位关联", + "name": "pac_auth_post", + "comment": "岗位", "engine": "", "characterSet": "", "collation": "", @@ -1090,7 +964,7 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": true, - "comment": "数据完整性确认", + "comment": "数据完整性验证", "columnFormat": "", "storage": "", "isVirtual": false, @@ -1101,7 +975,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "post_id", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -1116,18 +990,96 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "岗位id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "post_id" }, { "objectType": "TableField_MYSQL", - "name": "post_id", + "name": "post_key", + "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": "post_key" + }, + { + "objectType": "TableField_MYSQL", + "name": "post_name", + "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": "post_name" + }, + { + "objectType": "TableField_MYSQL", + "name": "post_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": "post_desc" + }, + { + "objectType": "TableField_MYSQL", + "name": "order_num", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -1139,17 +1091,43 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "排序:默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_id" + "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", @@ -1342,8 +1320,8 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "index", - "keyLength": -2147483648, + "name": "post_id", + "keyLength": 0, "order": "", "oldName": "" } @@ -1359,8 +1337,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_dept", - "comment": "系统组织架构", + "name": "pac_auth_user", + "comment": "用户表", "engine": "", "characterSet": "", "collation": "", @@ -1435,8 +1413,8 @@ }, { "objectType": "TableField_MYSQL", - "name": "dept_id", - "type": "int", + "name": "user_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -1450,20 +1428,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": "int", - "length": -2147483648, + "name": "username", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1473,23 +1451,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, @@ -1502,18 +1480,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, @@ -1523,25 +1501,25 @@ "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": "dept_name" + "oldName": "nickname" }, { "objectType": "TableField_MYSQL", - "name": "dept_desc", - "type": "varchar", - "length": 255, + "name": "user_type", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1549,25 +1527,25 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门描述", + "comment": "用户类型,来源英语字典,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_desc" + "oldName": "user_type" }, { "objectType": "TableField_MYSQL", - "name": "dept_type", - "type": "int", - "length": -2147483648, + "name": "user_email", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1575,24 +1553,24 @@ "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": "dept_type" + "oldName": "user_email" }, { "objectType": "TableField_MYSQL", - "name": "dept_leader", - "type": "int", + "name": "pid", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -1601,23 +1579,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "部门负责人,默认可以没有", + "comment": "父账户,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_leader" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "default_role", + "name": "wx_appid", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -1632,20 +1610,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认角色,默认可以没有", + "comment": "微信id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "default_role" + "oldName": "wx_appid" }, { "objectType": "TableField_MYSQL", - "name": "order_num", - "type": "int", - "length": -2147483648, + "name": "avatar", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1653,25 +1631,25 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序,默认0", + "comment": "图标", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "avatar" }, { "objectType": "TableField_MYSQL", - "name": "status", - "type": "int", - "length": -2147483648, + "name": "user_phone", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -1679,52 +1657,52 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:默认0启用,1禁用", + "comment": "电话", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "user_phone" }, { "objectType": "TableField_MYSQL", - "name": "createby", - "type": "int", - "length": 0, - "decimals": 0, + "name": "user_desc", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "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": "createby" + "oldName": "user_desc" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "status", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -1733,7 +1711,85 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "状态:0默认正常,1禁用,2临时锁定", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "status" + }, + { + "objectType": "TableField_MYSQL", + "name": "have_children", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "存在子账户:默认0,不存在", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "have_children" + }, + { + "objectType": "TableField_MYSQL", + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "创建人", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "createby" + }, + { + "objectType": "TableField_MYSQL", + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "None", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, "comment": "创建时间", @@ -1748,7 +1804,7 @@ { "objectType": "TableField_MYSQL", "name": "updateby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -1800,7 +1856,7 @@ { "objectType": "TableField_MYSQL", "name": "deleteby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -1876,6 +1932,32 @@ "oldName": "" } ] + }, + { + "objectType": "Index_MYSQL", + "name": "username", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", + "collation": "", + "cardinality": "", + "packed": "", + "IsVisibleIndex": true, + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "username", + "keyLength": 0, + "order": "", + "oldName": "" + } + ] } ], "primaryKey": { @@ -1884,7 +1966,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "dept_id", + "name": "user_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -1901,8 +1983,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_post", - "comment": "岗位", + "name": "pac_core_dict", + "comment": "核心字典", "engine": "", "characterSet": "", "collation": "", @@ -1966,7 +2048,7 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": true, - "comment": "数据完整性验证", + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, @@ -1977,8 +2059,8 @@ }, { "objectType": "TableField_MYSQL", - "name": "post_id", - "type": "int", + "name": "dict_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -1992,44 +2074,44 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位id", + "comment": "字典项id,", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_id" + "oldName": "dict_id" }, { "objectType": "TableField_MYSQL", - "name": "post_key", - "type": "varchar", - "length": 255, + "name": "pid", + "type": "bigint", + "length": -2147483648, "decimals": -2147483648, - "isUnsigned": false, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位标识", + "comment": "字典项的父id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_key" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "post_name", + "name": "dict_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2039,23 +2121,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位名称", + "comment": "字典项的唯一标识,id的显式表达", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_name" + "oldName": "dict_key" }, { "objectType": "TableField_MYSQL", - "name": "post_desc", + "name": "dict_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2070,20 +2152,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "岗位描述", + "comment": "字典项描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "post_desc" + "oldName": "dict_desc" }, { "objectType": "TableField_MYSQL", - "name": "order_num", - "type": "int", - "length": -2147483648, + "name": "dict_name", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2093,23 +2175,23 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序:默认0", + "comment": "字典项名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "dict_name" }, { "objectType": "TableField_MYSQL", - "name": "status", - "type": "int", - "length": -2147483648, + "name": "dict_icon", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2118,26 +2200,26 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", + "defaultType": "Empty", + "defaultValue": "Empty String", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "状态:默认0可以用,1禁用", + "comment": "字典项的图标", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "dict_icon" }, { "objectType": "TableField_MYSQL", - "name": "createby", + "name": "dict_type", "type": "int", - "length": 0, - "decimals": 0, - "isUnsigned": false, + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -2145,25 +2227,25 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建人", + "comment": "字典类型:0字符串、1图片、2图标,后面可拓展", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "dict_type" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, - "isUnsigned": false, + "name": "root", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -2171,254 +2253,76 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "默认0公有数据", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" + "oldName": "root" }, { "objectType": "TableField_MYSQL", - "name": "updateby", + "name": "order_num", "type": "int", - "length": 0, - "decimals": 0, - "isUnsigned": false, + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "更新人", + "comment": "排序,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "updateby" + "oldName": "order_num" }, { "objectType": "TableField_MYSQL", - "name": "updatetime", - "type": "datetime", - "length": 0, - "decimals": 0, - "isUnsigned": false, + "name": "status", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, + "isUnsigned": true, "isZeroFill": false, "setEnumValues": "", "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": "updatetime" + "oldName": "status" }, { "objectType": "TableField_MYSQL", - "name": "deleteby", - "type": "int", - "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": "", - "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": "post_id", - "keyLength": 0, - "order": "", - "oldName": "" - } - ], - "oldName": "", - "indexMethod": "", - "comment": "" - }, - "foreignKeys": [], - "checks": [], - "triggers": [], - "tablePartitions": [] - }, - { - "objectType": "Table_MYSQL", - "name": "pac_auth_link_user_dept", - "comment": "用户部门关联", - "engine": "", - "characterSet": "", - "collation": "", - "autoIncrement": 0, - "tablespace": "", - "storage": "", - "insertMethod": "", - "connection": "", - "checksum": false, - "rowFormat": "", - "avgRowLength": 0, - "maxRows": 0, - "minRows": 0, - "keyBlockSize": 0, - "packKeys": "", - "delayKeyWrite": false, - "dataDirectory": "", - "indexDirectory": "", - "statsAutoRecalc": "", - "statsPersistent": "", - "statsSamplePages": 0, - "union": "", - "pageCheckSum": false, - "transactional": false, - "compression": "", - "oldName": "", - "encryption": false, - "createOptions": "", - "createTime": "", - "checkTime": "", - "dataFree": 0, - "dataLength": 0, - "indexLength": 0, - "maxDataLength": 0, - "rows": 0, - "updateTime": "", - "DDL": "", - "partitionBy": "", - "partitionByExpr": "", - "partitions": 0, - "partitionKeyAlgorithm": "", - "subPartitionBy": "", - "subPartitionByExpr": "", - "subPartitions": 0, - "subPartitionKeyAlgorithm": "", - "fields": [ - { - "objectType": "TableField_MYSQL", - "name": "index", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": true, - "comment": "数据完整性确认", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "index" - }, - { - "objectType": "TableField_MYSQL", - "name": "user_id", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, + "name": "serviceKey", + "type": "varchar", + "length": 255, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -2426,22 +2330,22 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Others", - "defaultValue": "", + "defaultType": "Empty", + "defaultValue": "Empty String", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "所属服务:0归属于当前服务:pacAuth", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "serviceKey" }, { "objectType": "TableField_MYSQL", - "name": "dept_id", + "name": "have_children", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -2453,22 +2357,22 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "是否含有子节点:默认0不含有,1含有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dept_id" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", "name": "createby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -2520,7 +2424,7 @@ { "objectType": "TableField_MYSQL", "name": "updateby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -2572,7 +2476,7 @@ { "objectType": "TableField_MYSQL", "name": "deleteby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -2656,7 +2560,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "index", + "name": "dict_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -2673,8 +2577,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_user", - "comment": "用户表", + "name": "pac_core_menu", + "comment": "系统菜单", "engine": "", "characterSet": "", "collation": "", @@ -2749,7 +2653,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "user_id", + "name": "menu_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -2764,20 +2668,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户id,可采用雪花id", + "comment": "菜单ID", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_id" + "oldName": "menu_id" }, { "objectType": "TableField_MYSQL", - "name": "username", - "type": "varchar", - "length": 255, + "name": "pid", + "type": "bigint", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2787,23 +2691,23 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户名", + "comment": "父ID", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "username" + "oldName": "pid" }, { "objectType": "TableField_MYSQL", - "name": "password", - "type": "varchar", - "length": 255, + "name": "have_children", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2813,21 +2717,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "密码", + "comment": "是否含有子节点:默认0不含有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "password" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "nickname", + "name": "api_path", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2837,25 +2741,25 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "昵称", + "comment": "后端权限地址", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "nickname" + "oldName": "api_path" }, { "objectType": "TableField_MYSQL", - "name": "user_type", - "type": "int", - "length": -2147483648, + "name": "web_path", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2863,23 +2767,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, + "isNullable": true, + "defaultType": "Null", + "defaultValue": "NULL", + "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户类型,来源英语字典,默认0", + "comment": "前端路由地址", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_type" + "oldName": "web_path" }, { "objectType": "TableField_MYSQL", - "name": "user_email", + "name": "web_component_path", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -2890,22 +2794,74 @@ "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, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "邮箱", + "comment": "菜单名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_email" + "oldName": "menu_name" }, { "objectType": "TableField_MYSQL", - "name": "pid", + "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, @@ -2920,20 +2876,20 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "父账户,默认0", + "comment": "菜单类型:来源于字典,默认0为默认类型", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "pid" + "oldName": "menu_type" }, { "objectType": "TableField_MYSQL", - "name": "wx_appid", - "type": "int", - "length": -2147483648, + "name": "menu_icon", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2946,20 +2902,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "微信id", + "comment": "菜单图标", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "wx_appid" + "oldName": "menu_icon" }, { "objectType": "TableField_MYSQL", - "name": "avatar", - "type": "varchar", - "length": 255, + "name": "is_frame", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2967,25 +2923,25 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "图标", + "comment": "是否是外链:默认0不是外链,1时外链", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "avatar" + "oldName": "is_frame" }, { "objectType": "TableField_MYSQL", - "name": "user_phone", - "type": "varchar", - "length": 255, + "name": "is_visible", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -2993,25 +2949,25 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "1", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "电话", + "comment": "是否为显示的菜单:默认0显示、1为不显示", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_phone" + "oldName": "is_visible" }, { "objectType": "TableField_MYSQL", - "name": "user_desc", - "type": "varchar", - "length": 255, + "name": "is_activate", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -3019,23 +2975,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "1", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "用户描述", + "comment": "是否激活:默认0为激活可用状态,1为不可用", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "user_desc" + "oldName": "is_activate" }, { "objectType": "TableField_MYSQL", - "name": "status", + "name": "order_num", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -3050,18 +3006,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, @@ -3076,14 +3032,40 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "存在子账户:默认0,不存在", + "comment": "菜单状态:0正常、1禁用", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" + "oldName": "status" + }, + { + "objectType": "TableField_MYSQL", + "name": "service_key", + "type": "varchar", + "length": 255, + "decimals": -2147483648, + "isUnsigned": false, + "isZeroFill": false, + "setEnumValues": "", + "isBinary": false, + "charset": "", + "collation": "", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "0", + "isOnUpdateCurrentTimestamp": false, + "isAutoInc": false, + "comment": "所属服务:0归属于当前服务:pacAuth", + "columnFormat": "", + "storage": "", + "isVirtual": false, + "isGeneratedAlways": false, + "virtualExpr": "", + "virtualType": "", + "oldName": "service_key" }, { "objectType": "TableField_MYSQL", @@ -3124,7 +3106,7 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "None", + "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, @@ -3268,32 +3250,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": { @@ -3302,7 +3258,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "user_id", + "name": "menu_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -3319,8 +3275,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_dict", - "comment": "核心字典", + "name": "pac_core_env", + "comment": "系统内运行时的环境变量", "engine": "", "characterSet": "", "collation": "", @@ -3395,7 +3351,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "dict_id", + "name": "env_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -3410,14 +3366,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项id,", + "comment": "变量id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_id" + "oldName": "env_id" }, { "objectType": "TableField_MYSQL", @@ -3425,18 +3381,18 @@ "type": "bigint", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", - "defaultValue": "", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的父id", + "comment": "env分组依据,默认0为没有分组", "columnFormat": "", "storage": "", "isVirtual": false, @@ -3447,7 +3403,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "dict_key", + "name": "env_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -3462,18 +3418,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的唯一标识,id的显式表达", + "comment": "变量名称", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_key" + "oldName": "env_name" }, { "objectType": "TableField_MYSQL", - "name": "dict_desc", + "name": "env_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -3483,23 +3439,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, + "isNullable": false, "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项描述", + "comment": "变量标识", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_desc" + "oldName": "env_key" }, { "objectType": "TableField_MYSQL", - "name": "dict_name", + "name": "env_val", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -3514,20 +3470,20 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项名称", + "comment": "变量值", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_name" + "oldName": "env_val" }, { "objectType": "TableField_MYSQL", - "name": "dict_icon", - "type": "varchar", - "length": 255, + "name": "val_is_dict", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -3536,52 +3492,52 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Empty", - "defaultValue": "Empty String", + "defaultType": "Others", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典项的图标", + "comment": "数值来源于字典:默认0不来源于字典,1来源于字典", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_icon" + "oldName": "val_is_dict" }, { "objectType": "TableField_MYSQL", - "name": "dict_type", - "type": "int", - "length": -2147483648, + "name": "env_desc", + "type": "varchar", + "length": 255, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": false, + "isNullable": true, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典类型:0字符串、1图片、2图标,后面可拓展", + "comment": "变量描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "dict_type" + "oldName": "env_desc" }, { "objectType": "TableField_MYSQL", - "name": "root", + "name": "have_children", "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -3592,22 +3548,22 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认0公有数据", + "comment": "含有子节点:默认0不含有,1含有", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "root" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "order_num", + "name": "root", "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -3618,22 +3574,22 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序,默认0", + "comment": "默认0,公共变量", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "root" }, { "objectType": "TableField_MYSQL", - "name": "status", + "name": "order_num", "type": "int", "length": -2147483648, "decimals": -2147483648, - "isUnsigned": true, + "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, @@ -3644,20 +3600,20 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "字典状态:0正常、1禁用可读", + "comment": "排序:默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "order_num" }, { "objectType": "TableField_MYSQL", - "name": "serviceKey", - "type": "varchar", - "length": 255, + "name": "status", + "type": "int", + "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -3666,24 +3622,24 @@ "charset": "", "collation": "", "isNullable": false, - "defaultType": "Empty", - "defaultValue": "Empty String", + "defaultType": "Others", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "所属服务:0归属于当前服务:pacAuth", + "comment": "变量状态:0正常、1不可用", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "serviceKey" + "oldName": "status" }, { "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", - "length": -2147483648, + "name": "service_key", + "type": "varchar", + "length": 255, "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, @@ -3696,14 +3652,14 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否含有子节点:默认0不含有,1含有", + "comment": "所属服务:0归属于当前服务:pacAuth", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "have_children" + "oldName": "service_key" }, { "objectType": "TableField_MYSQL", @@ -3896,7 +3852,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "dict_id", + "name": "env_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -3913,8 +3869,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_menu", - "comment": "系统菜单", + "name": "pac_auth_role", + "comment": "角色", "engine": "", "characterSet": "", "collation": "", @@ -3989,7 +3945,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "menu_id", + "name": "role_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4004,14 +3960,14 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单ID", + "comment": "角色id", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_id" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", @@ -4030,7 +3986,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "父ID", + "comment": "父id", "columnFormat": "", "storage": "", "isVirtual": false, @@ -4041,85 +3997,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "是否含有子节点:默认0不含有", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "have_children" - }, - { - "objectType": "TableField_MYSQL", - "name": "api_path", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "后端权限地址", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "api_path" - }, - { - "objectType": "TableField_MYSQL", - "name": "web_path", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "前端路由地址", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "web_path" - }, - { - "objectType": "TableField_MYSQL", - "name": "web_component_path", + "name": "role_name", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -4129,23 +4007,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "", + "comment": "角色名", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "web_component_path" + "oldName": "role_name" }, { "objectType": "TableField_MYSQL", - "name": "menu_name", + "name": "role_key", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -4160,18 +4038,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单名称", + "comment": "角色标识", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_name" + "oldName": "role_key" }, { "objectType": "TableField_MYSQL", - "name": "menu_desc", + "name": "role_desc", "type": "varchar", "length": 255, "decimals": -2147483648, @@ -4186,18 +4064,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单描述", + "comment": "角色描述", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_desc" + "oldName": "role_desc" }, { "objectType": "TableField_MYSQL", - "name": "menu_type", + "name": "role_type", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4212,44 +4090,18 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单类型:来源于字典,默认0为默认类型", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "menu_type" - }, - { - "objectType": "TableField_MYSQL", - "name": "menu_icon", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "菜单图标", + "comment": "来源于字典,默认0", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "menu_icon" + "oldName": "role_type" }, { "objectType": "TableField_MYSQL", - "name": "is_frame", + "name": "dept_scope", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -4261,21 +4113,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "1", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否是外链:默认0不是外链,1时外链", + "comment": "数据范围:默认全部1(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "is_frame" + "oldName": "dept_scope" }, { "objectType": "TableField_MYSQL", - "name": "is_visible", + "name": "have_children", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -4287,21 +4139,21 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "1", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否为显示的菜单:默认0显示、1为不显示", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "is_visible" + "oldName": "have_children" }, { "objectType": "TableField_MYSQL", - "name": "is_activate", + "name": "root", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -4313,17 +4165,17 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "1", + "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "是否激活:默认0为激活可用状态,1为不可用", + "comment": "1是属于Root的,无法删除和修改", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "is_activate" + "oldName": "root" }, { "objectType": "TableField_MYSQL", @@ -4368,7 +4220,7 @@ "defaultValue": "0", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "菜单状态:0正常、1禁用", + "comment": "状态:默认0可用,1禁用", "columnFormat": "", "storage": "", "isVirtual": false, @@ -4377,32 +4229,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", @@ -4594,7 +4420,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "menu_id", + "name": "role_id", "keyLength": -2147483648, "order": "", "oldName": "" @@ -4611,8 +4437,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_core_env", - "comment": "系统内运行时的环境变量", + "name": "pac_auth_link_user_post", + "comment": "用户岗位关联", "engine": "", "characterSet": "", "collation": "", @@ -4687,7 +4513,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "env_id", + "name": "user_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4702,18 +4528,18 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量id", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_id" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "pid", + "name": "post_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -4725,24 +4551,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "env分组依据,默认0为没有分组", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "pid" + "oldName": "post_id" }, { "objectType": "TableField_MYSQL", - "name": "env_name", - "type": "varchar", - "length": 255, - "decimals": -2147483648, + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4754,21 +4580,21 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量名称", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_name" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "env_key", - "type": "varchar", - "length": 255, - "decimals": -2147483648, + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4780,44 +4606,118 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "变量标识", + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_key" - }, + "oldName": "createtime" + } + ], + "indexes": [ { - "objectType": "TableField_MYSQL", - "name": "env_val", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", + "objectType": "Index_MYSQL", + "name": "pac_index", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "变量值", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "env_val" - }, + "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": "val_is_dict", + "name": "index", "type": "int", "length": -2147483648, "decimals": -2147483648, @@ -4829,48 +4729,22 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "数值来源于字典:默认0不来源于字典,1来源于字典", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "val_is_dict" - }, - { - "objectType": "TableField_MYSQL", - "name": "env_desc", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "变量描述", + "isAutoInc": true, + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "env_desc" + "oldName": "index" }, { "objectType": "TableField_MYSQL", - "name": "have_children", - "type": "int", + "name": "user_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -4881,22 +4755,22 @@ "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": "have_children" + "oldName": "user_id" }, { "objectType": "TableField_MYSQL", - "name": "root", - "type": "int", + "name": "role_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -4907,24 +4781,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "默认0,公共变量", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "root" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", - "name": "order_num", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, + "name": "createby", + "type": "bigint", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4933,24 +4807,24 @@ "collation": "", "isNullable": false, "defaultType": "Others", - "defaultValue": "0", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "排序:默认0", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "order_num" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "status", - "type": "int", - "length": -2147483648, - "decimals": -2147483648, + "name": "createtime", + "type": "datetime", + "length": 0, + "decimals": 0, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -4959,50 +4833,124 @@ "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": "createtime" + } + ], + "indexes": [ { - "objectType": "TableField_MYSQL", - "name": "service_key", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", + "objectType": "Index_MYSQL", + "name": "pac_index", + "type": "UNIQUE", + "method": "", + "comment": "", + "oldName": "", + "online": false, + "keyBlockSize": 0, + "parser": "", + "algorithm": "", + "lock": "", "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "所属服务:0归属于当前服务:pacAuth", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "service_key" - }, + "cardinality": "", + "packed": "", + "IsVisibleIndex": true, + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": 0, + "order": "", + "oldName": "" + } + ] + } + ], + "primaryKey": { + "objectType": "PrimaryKey_MYSQL", + "name": "", + "fields": [ + { + "objectType": "IndexField_MYSQL", + "name": "index", + "keyLength": -2147483648, + "order": "", + "oldName": "" + } + ], + "oldName": "", + "indexMethod": "", + "comment": "" + }, + "foreignKeys": [], + "checks": [], + "triggers": [], + "tablePartitions": [] + }, + { + "objectType": "Table_MYSQL", + "name": "pac_auth_link_role_dept", + "comment": "角色的自定义数据权限范围(部门)", + "engine": "", + "characterSet": "", + "collation": "", + "autoIncrement": 0, + "tablespace": "", + "storage": "", + "insertMethod": "", + "connection": "", + "checksum": false, + "rowFormat": "", + "avgRowLength": 0, + "maxRows": 0, + "minRows": 0, + "keyBlockSize": 0, + "packKeys": "", + "delayKeyWrite": false, + "dataDirectory": "", + "indexDirectory": "", + "statsAutoRecalc": "", + "statsPersistent": "", + "statsSamplePages": 0, + "union": "", + "pageCheckSum": false, + "transactional": false, + "compression": "", + "oldName": "", + "encryption": false, + "createOptions": "", + "createTime": "", + "checkTime": "", + "dataFree": 0, + "dataLength": 0, + "indexLength": 0, + "maxDataLength": 0, + "rows": 0, + "updateTime": "", + "DDL": "", + "partitionBy": "", + "partitionByExpr": "", + "partitions": 0, + "partitionKeyAlgorithm": "", + "subPartitionBy": "", + "subPartitionByExpr": "", + "subPartitions": 0, + "subPartitionKeyAlgorithm": "", + "fields": [ { "objectType": "TableField_MYSQL", - "name": "createby", - "type": "bigint", - "length": 0, - "decimals": 0, + "name": "index", + "type": "int", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -5013,22 +4961,22 @@ "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "创建人", + "isAutoInc": true, + "comment": "数据完整性确认", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createby" + "oldName": "index" }, { "objectType": "TableField_MYSQL", - "name": "createtime", - "type": "datetime", - "length": 0, - "decimals": 0, + "name": "role_id", + "type": "bigint", + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", @@ -5040,70 +4988,44 @@ "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "创建时间", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "createtime" + "oldName": "role_id" }, { "objectType": "TableField_MYSQL", - "name": "updateby", + "name": "dept_id", "type": "bigint", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "更新人", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "updateby" - }, - { - "objectType": "TableField_MYSQL", - "name": "updatetime", - "type": "datetime", - "length": 0, - "decimals": 0, + "length": -2147483648, + "decimals": -2147483648, "isUnsigned": false, "isZeroFill": false, "setEnumValues": "", "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "更新时间", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "updatetime" + "oldName": "dept_id" }, { "objectType": "TableField_MYSQL", - "name": "deleteby", + "name": "createby", "type": "bigint", "length": 0, "decimals": 0, @@ -5113,23 +5035,23 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "删除人", + "comment": "创建人", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "deleteby" + "oldName": "createby" }, { "objectType": "TableField_MYSQL", - "name": "deletetime", + "name": "createtime", "type": "datetime", "length": 0, "decimals": 0, @@ -5139,19 +5061,19 @@ "isBinary": false, "charset": "", "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", + "isNullable": false, + "defaultType": "Others", + "defaultValue": "", "isOnUpdateCurrentTimestamp": false, "isAutoInc": false, - "comment": "删除时间", + "comment": "创建时间", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "deletetime" + "oldName": "createtime" } ], "indexes": [ @@ -5185,15 +5107,7 @@ "primaryKey": { "objectType": "PrimaryKey_MYSQL", "name": "", - "fields": [ - { - "objectType": "IndexField_MYSQL", - "name": "env_id", - "keyLength": -2147483648, - "order": "", - "oldName": "" - } - ], + "fields": [], "oldName": "", "indexMethod": "", "comment": "" @@ -5205,8 +5119,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_link_role_dept", - "comment": "角色的自定义数据权限范围(部门)", + "name": "pac_auth_link_role_menu", + "comment": "角色菜单关联", "engine": "", "characterSet": "", "collation": "", @@ -5282,7 +5196,7 @@ { "objectType": "TableField_MYSQL", "name": "role_id", - "type": "int", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -5307,34 +5221,8 @@ }, { "objectType": "TableField_MYSQL", - "name": "dept_id", - "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": "", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "dept_id" - }, - { - "objectType": "TableField_MYSQL", - "name": "scope_id", - "type": "int", + "name": "menu_id", + "type": "bigint", "length": -2147483648, "decimals": -2147483648, "isUnsigned": false, @@ -5355,12 +5243,12 @@ "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "scope_id" + "oldName": "menu_id" }, { "objectType": "TableField_MYSQL", "name": "createby", - "type": "int", + "type": "bigint", "length": 0, "decimals": 0, "isUnsigned": false, @@ -5408,110 +5296,6 @@ "virtualExpr": "", "virtualType": "", "oldName": "createtime" - }, - { - "objectType": "TableField_MYSQL", - "name": "updateby", - "type": "int", - "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": "int", - "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": [ @@ -5548,7 +5332,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "scope_id", + "name": "index", "keyLength": -2147483648, "order": "", "oldName": "" @@ -5565,8 +5349,8 @@ }, { "objectType": "Table_MYSQL", - "name": "pac_auth_role", - "comment": "角色", + "name": "pac_auth_link_user_dept", + "comment": "用户部门关联", "engine": "", "characterSet": "", "collation": "", @@ -5629,7 +5413,7 @@ "defaultType": "Others", "defaultValue": "", "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, + "isAutoInc": true, "comment": "数据完整性确认", "columnFormat": "", "storage": "", @@ -5641,7 +5425,7 @@ }, { "objectType": "TableField_MYSQL", - "name": "role_id", + "name": "user_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -5656,18 +5440,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": "dept_id", "type": "bigint", "length": -2147483648, "decimals": -2147483648, @@ -5679,225 +5463,17 @@ "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": "role_name", - "type": "varchar", - "length": 255, - "decimals": -2147483648, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "角色名", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "role_name" - }, - { - "objectType": "TableField_MYSQL", - "name": "role_key", - "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": "role_key" - }, - { - "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": "", - "collation": "", - "isNullable": false, - "defaultType": "Others", - "defaultValue": "0", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "来源于字典,默认0", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "role_type" - }, - { - "objectType": "TableField_MYSQL", - "name": "dept_scope", - "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": "数据范围:默认全部1(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "dept_scope" - }, - { - "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" - }, - { - "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禁用", + "comment": "", "columnFormat": "", "storage": "", "isVirtual": false, "isGeneratedAlways": false, "virtualExpr": "", "virtualType": "", - "oldName": "status" + "oldName": "dept_id" }, { "objectType": "TableField_MYSQL", @@ -5950,110 +5526,6 @@ "virtualExpr": "", "virtualType": "", "oldName": "createtime" - }, - { - "objectType": "TableField_MYSQL", - "name": "updateby", - "type": "bigint", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "更新人", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "updateby" - }, - { - "objectType": "TableField_MYSQL", - "name": "updatetime", - "type": "datetime", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "更新时间", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "updatetime" - }, - { - "objectType": "TableField_MYSQL", - "name": "deleteby", - "type": "bigint", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "删除人", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "deleteby" - }, - { - "objectType": "TableField_MYSQL", - "name": "deletetime", - "type": "datetime", - "length": 0, - "decimals": 0, - "isUnsigned": false, - "isZeroFill": false, - "setEnumValues": "", - "isBinary": false, - "charset": "", - "collation": "", - "isNullable": true, - "defaultType": "Null", - "defaultValue": "NULL", - "isOnUpdateCurrentTimestamp": false, - "isAutoInc": false, - "comment": "删除时间", - "columnFormat": "", - "storage": "", - "isVirtual": false, - "isGeneratedAlways": false, - "virtualExpr": "", - "virtualType": "", - "oldName": "deletetime" } ], "indexes": [ @@ -6090,7 +5562,7 @@ "fields": [ { "objectType": "IndexField_MYSQL", - "name": "role_id", + "name": "index", "keyLength": -2147483648, "order": "", "oldName": "" diff --git a/src/application/app.module.ts b/src/application/app.module.ts index b318ee6..1d92cc6 100644 --- a/src/application/app.module.ts +++ b/src/application/app.module.ts @@ -14,6 +14,7 @@ import { CoreDictModule } from './core-dict/core-dict.module'; import { GlobalModule } from '@app/global.module'; import { CoreEnvModule } from './core-env/core-env.module'; import { CoreMenuModule } from './core-menu/core-menu.module'; +import { AuthRoleModule } from './auth-role/auth-role.module'; @Module({ imports: [ @@ -27,6 +28,7 @@ import { CoreMenuModule } from './core-menu/core-menu.module'; CoreDictModule, CoreEnvModule, CoreMenuModule, + AuthRoleModule, ], controllers: [AppController], providers: [ diff --git a/src/application/auth-role/auth-role.controller.ts b/src/application/auth-role/auth-role.controller.ts new file mode 100644 index 0000000..9a4efbe --- /dev/null +++ b/src/application/auth-role/auth-role.controller.ts @@ -0,0 +1,63 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common'; +import { AuthRoleService } from './auth-role.service'; +import { CreateAuthRoleDto } from './dto/create-auth-role.dto'; +import { UpdateAuthRoleDto } from './dto/update-auth-role.dto'; +import { ApiOperation, ApiProduces, ApiTags } from '@nestjs/swagger'; +import { PacInfo } from '@common/decorator/pac-info/pac-info.decorator'; +import { PacInfoType } from '@utils/myType'; +import { query } from 'express'; +import { GetPacAuthRoleAllDto } from '@app/auth-role/dto/get-auth-role.dto'; + +@ApiTags('角色服务') +@Controller('authRole') +export class AuthRoleController { + constructor(private readonly authRoleService: AuthRoleService) {} + + @ApiOperation({ + summary: '添加角色', + description: '增加一个角色,菜单和数据权限', + }) + @ApiProduces('application/json') + @Post() + create(@Body() createAuthRoleDto: CreateAuthRoleDto, @PacInfo() pacInfo: PacInfoType) { + return this.authRoleService.create(createAuthRoleDto, pacInfo); + } + + @ApiOperation({ + summary: '获取角色列表', + description: '查询角色分页或者列表', + }) + @ApiProduces('application/json') + @Get() + findAll(@Query() getPacAuthRoleAllDto: GetPacAuthRoleAllDto) { + return this.authRoleService.findAll(getPacAuthRoleAllDto); + } + @ApiOperation({ + summary: '获取角色详细信息', + description: '查询角色详细信息,目录菜单列表,数据权限范围', + }) + @ApiProduces('application/json') + @Get(':id') + findOne(@Param('id') id: string) { + return this.authRoleService.findOne(+id); + } + + @ApiOperation({ + summary: '更新角色信息', + description: '更新角色信息', + }) + @ApiProduces('application/json') + @Patch(':id') + update(@Param('id') id: string, @Body() updateAuthRoleDto: UpdateAuthRoleDto) { + return this.authRoleService.update(+id, updateAuthRoleDto); + } + @ApiOperation({ + summary: '删除目标角色', + description: '删除目标角色信息', + }) + @ApiProduces('application/json') + @Delete(':id') + remove(@Param('id') id: string) { + return this.authRoleService.remove(+id); + } +} diff --git a/src/application/auth-role/auth-role.module.ts b/src/application/auth-role/auth-role.module.ts new file mode 100644 index 0000000..b71d4a5 --- /dev/null +++ b/src/application/auth-role/auth-role.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { AuthRoleService } from './auth-role.service'; +import { AuthRoleController } from './auth-role.controller'; + +@Module({ + controllers: [AuthRoleController], + providers: [AuthRoleService], +}) +export class AuthRoleModule {} diff --git a/src/application/auth-role/auth-role.service.ts b/src/application/auth-role/auth-role.service.ts new file mode 100644 index 0000000..da8c6a7 --- /dev/null +++ b/src/application/auth-role/auth-role.service.ts @@ -0,0 +1,208 @@ +import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; +import { CreateAuthRoleDto } from './dto/create-auth-role.dto'; +import { UpdateAuthRoleDto } from './dto/update-auth-role.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 { PacInfoType } from '@utils/myType'; +import { isTrueEnum } from '@utils/boolean.enum'; +import { pacAuthLinkRoleDept, pacAuthLinkRoleMenu, pacAuthRole, pacAuthUser, pacCoreDict } from '@entities/schema'; +import { and, eq, isNull, sql } from 'drizzle-orm'; +import { GetPacAuthRoleAllDto } from '@app/auth-role/dto/get-auth-role.dto'; + +@Injectable() +export class AuthRoleService { + // 基本分页信息 + private readonly roleBaseType = {}; + + // 角色详细信息 + private readonly roleMoreType = { + roleId: pacAuthRole.roleId, + pid: pacAuthRole.pid, + roleName: pacAuthRole.roleName, + roleKey: pacAuthRole.roleKey, + roleDesc: pacAuthRole.roleDesc, + roleType: pacAuthRole.roleType, + roleTypeName: pacCoreDict.dictName, + roleTypeKey: pacCoreDict.dictKey, + deptScope: pacAuthRole.deptScope, + root: pacAuthRole.root, + orderNum: pacAuthRole.orderNum, + status: pacAuthRole.status, + createby: pacAuthRole.createby, + createName: pacAuthUser.nickname, + createtime: pacAuthRole.createtime, + updateby: pacAuthRole.updateby, + updateName: pacAuthUser.nickname, + updatetime: pacAuthRole.updatetime, + }; + + // 角色列表/数信息 + private readonly roleListType = { + roleId: pacAuthRole.roleId, + pid: pacAuthRole.pid, + roleName: pacAuthRole.roleName, + roleKey: pacAuthRole.roleKey, + roleType: pacAuthRole.roleType, + roleTypeName: pacCoreDict.dictName, + deptScope: pacAuthRole.deptScope, + orderNum: pacAuthRole.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-25 15:53:04 - + * */ + public async create(createAuthRoleDto: CreateAuthRoleDto, pacInfo: PacInfoType) { + // ! 判断是否是root账户,非root账户无法设置为root + if (this.config.get('masterId') !== pacInfo.userId && isTrueEnum(createAuthRoleDto.root)) { + throw new HttpException('没有权限创建原始角色!', HttpStatus.UNAUTHORIZED); + } + + // ! 加目标锁 + const lock = await this.redisService.distributedLock('DICT' + createAuthRoleDto.roleKey, createAuthRoleDto.roleKey); + + // ? 存在正在进行写入的角色 + if (!lock) throw new HttpException('服务繁忙,角色标识重复!', HttpStatus.CONFLICT); + + // @ 核心内容 + try { + // ! 查重 + const result = await this.getRoleForRoleKey(createAuthRoleDto.roleKey); + + // ? 是否存在重复的角色 + if (result.length > 0) throw new HttpException('角色标识重复!', HttpStatus.CONFLICT); + + // ! 添加角色数据 + const newRoleResult = await this.addRoleData(createAuthRoleDto, pacInfo.userId).catch((e) => { + this.logger.error(e.message + e.track.toString()); + throw new HttpException('角色写入错误!', HttpStatus.INTERNAL_SERVER_ERROR); + }); + + // ! 增加关联菜单 + await this.createMenuLink(newRoleResult.roleId, createAuthRoleDto.menuList, pacInfo.userId).catch((e) => { + this.logger.error(e.message + e.track.toString()); + throw new HttpException('添加菜单关系出现错误,角色写入错误!', HttpStatus.INTERNAL_SERVER_ERROR); + }); + + // ! 增加关联部门 + await this.createDeptLink(newRoleResult.roleId, createAuthRoleDto.deptList, pacInfo.userId).catch((e) => { + this.logger.error(e.message + e.track.toString()); + throw new HttpException('添加部门数据范围关系出现错误,角色写入错误!', HttpStatus.INTERNAL_SERVER_ERROR); + }); + + // ! 解锁 + lock(); + + // !更新父节点的子节点数量 + await this.haveChildrenSelfIncreasing(createAuthRoleDto.pid); + + // ! 返回结果 + return newRoleResult; + } catch (e) { + // ! 解锁 + lock(); + + // ! 抛出错误 + throw e; + } + } + + findAll(getPacAuthRoleAllDto: GetPacAuthRoleAllDto) { + return `This action returns all authRole`; + } + + findOne(id: number) { + return `This action returns a #${id} authRole`; + } + + update(id: number, updateAuthRoleDto: UpdateAuthRoleDto) { + return `This action updates a #${id} authRole`; + } + + remove(id: number) { + return `This action removes a #${id} authRole`; + } + + // DB 通过roleKey查找角色信息 + private getRoleForRoleKey(key: string) { + return this.mysqlService.db + .select() + .from(pacAuthRole) + .where(and(isNull(pacAuthRole.deleteby), eq(pacAuthRole.roleKey, key))); + } + + // DB 添加角色信息 + private async addRoleData(createAuthRoleDto: CreateAuthRoleDto, userId) { + // ! 生成雪花id,用于角色主键 + const id = await this.snowflake.generate(); + + // ! 定义写入的角色数据 + const newRoleData: typeof pacAuthRole.$inferInsert = { + roleId: id as any, + pid: createAuthRoleDto.pid, + roleName: createAuthRoleDto.roleName, + roleKey: createAuthRoleDto.roleKey, + roleDesc: createAuthRoleDto.roleDesc, + roleType: createAuthRoleDto.roleType, + deptScope: createAuthRoleDto.deptScope, + root: isTrueEnum(createAuthRoleDto.root) ? 1 : 0, + orderNum: createAuthRoleDto.orderNum, + createby: userId, + createtime: sql`now()` as any, + }; + const result = await this.mysqlService.db.insert(pacAuthRole).values(newRoleData); + return { + ...result[0], + roleId: id.toString(), + }; + } + + // DB 更新父级子元素数量 + private async haveChildrenSelfIncreasing(roleId: string, isAdd = true) { + return this.mysqlService.db + .update(pacAuthRole) + .set({ + haveChildren: isAdd ? sql`${pacAuthRole.haveChildren} + 1` : sql`${pacAuthRole.haveChildren} - 1`, + }) + .where(eq(pacAuthRole.roleId as any, roleId)); + } + + // DB 建立菜单角色关联 + private async createMenuLink(roleId, menuIdList, userId) { + const newMenuIdList = Array.from(new Set(menuIdList)); + await this.mysqlService.db.delete(pacAuthLinkRoleMenu).where(eq(pacAuthLinkRoleMenu.roleId as any, roleId)); + await this.mysqlService.db.insert(pacAuthLinkRoleMenu).values( + newMenuIdList.map((i) => ({ + roleId, + menuId: i, + createby: userId, + createtime: sql`now()` as any, + })), + ); + } + + // DB 建立部门角色关联 + private async createDeptLink(roleId, deptIdList, userId) { + const newDeptIdList = Array.from(new Set(deptIdList)); + await this.mysqlService.db.delete(pacAuthLinkRoleDept).where(eq(pacAuthLinkRoleDept.roleId as any, roleId)); + await this.mysqlService.db.insert(pacAuthLinkRoleDept).values( + newDeptIdList.map((i) => ({ + roleId, + deptId: i, + createby: userId, + createtime: sql`now()` as any, + })), + ); + } +} diff --git a/src/application/auth-role/dto/create-auth-role.dto.ts b/src/application/auth-role/dto/create-auth-role.dto.ts new file mode 100644 index 0000000..2b4962b --- /dev/null +++ b/src/application/auth-role/dto/create-auth-role.dto.ts @@ -0,0 +1,154 @@ +import { ApiProperty } from '@nestjs/swagger'; +import Trim from '@common/decorator/trim/trim.decorator'; +import { ArrayMinSize, IsEnum, IsInt, IsOptional, IsString, Length, Max, MaxLength, Min, MinLength } from 'class-validator'; +import { BooleanEnum } from '@utils/boolean.enum'; +import ChangeCase, { + CaseType +} from "@common/decorator/change-case/change-case.decorator"; + +export class CreateAuthRoleDto { + @ApiProperty({ + description: '角色父ID', + type: String, + example: '0', + required: false, + minLength: 1, + maxLength: 32, + }) + @Trim() + @IsString({ message: '角色关联属性应为字符串格式!' }) + @IsOptional() + readonly pid?: string = '0'; + + @ApiProperty({ + description: '角色名称', + type: String, + example: '管理员', + required: true, + minLength: 1, + maxLength: 32, + }) + @Trim() + @IsString({ message: '角色名称应为字符串格式!' }) + @Length(1, 32, { message: '角色名称长度控制在1到32位之间!' }) + readonly roleName: string; + + @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 roleKey: string; + + @ApiProperty({ + description: '角色类型,来自于字典', + type: String, + example: '0', + required: false, + minLength: 19, + maxLength: 19, + }) + @Trim() + @IsString({ message: '角色类型格式不正确!' }) + @Length(19, 19, { message: '角色类型格式不正确!' }) + @IsOptional() + readonly roleType: string; + + @ApiProperty({ + description: '角色描述', + type: String, + example: '0', + required: false, + minLength: 1, + maxLength: 255, + }) + @Trim() + @IsString({ message: '角色描述应为字符串格式!' }) + @Length(1, 255, { message: '请将角色描述长度控制在1到255位之间!' }) + @IsOptional() + readonly roleDesc?: string; + + @ApiProperty({ + description: '数据权限范围', + type: Number, + example: 10, + required: false, + minimum: -1000, + maximum: 1000, + }) + @IsOptional() + @IsInt({ + message: '数据权限范围必须是整数!', + }) + @Min(0, { + message: '数据权限范围不能小于0!', + }) + @Max(5, { + message: '数据权限范围不能超过5', + }) + readonly deptScope?: number = 0; + + @ApiProperty({ + description: '数据范围组织部门Id列表', + type: [String], + example: ['a'], + required: false, + minItems: 1, + }) + @IsString({ each: true, message: '部门id格式错误' }) + @ArrayMinSize(1, { message: '至少需要选择一个部门作为数据范围' }) + @Length(19, 19, { each: true, message: '部门id格式错误' }) + @IsOptional() + readonly deptList?: string[]; + + @ApiProperty({ + description: '菜单列表', + type: [String], + example: ['a'], + required: false, + minItems: 1, + }) + @IsString({ each: true, message: '菜单id格式错误' }) + @ArrayMinSize(1, { message: '至少需要选择一个菜单作为权限' }) + @Length(19, 19, { each: true, message: '菜单id格式错误' }) + readonly menuList?: string[]; + + @ApiProperty({ + description: '是否属于PAC', + type: BooleanEnum, + enum: BooleanEnum, + example: false, + required: false, + }) + @Trim() + @IsEnum(BooleanEnum, { message: 'root参数格式错误' }) + @IsOptional() + readonly root?: BooleanEnum = BooleanEnum.FALSE; + + @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-role/dto/get-auth-role.dto.ts b/src/application/auth-role/dto/get-auth-role.dto.ts new file mode 100644 index 0000000..80b9dd3 --- /dev/null +++ b/src/application/auth-role/dto/get-auth-role.dto.ts @@ -0,0 +1,113 @@ +// | ------------------------------------------------------------ +// | @版本: version 0.1 +// | @创建人: 【Nie-x7129】 +// | @E-mail: x71291@outlook.com +// | @所在项目: pac-auth +// | @文件描述: get-auth-role.dto.ts - +// | @创建时间: 2024-06-25 17:22 +// | @更新时间: 2024-06-25 17:22 +// | @修改记录: +// | -*-*-*- (时间--修改人--修改说明) -*-*-*- +// | = +// | ------------------------------------------------------------ + +import { GetDto } from '@dto/get.dto'; +import { ApiProperty } from '@nestjs/swagger'; +import Trim from '@common/decorator/trim/trim.decorator'; +import { IsEnum, IsInt, IsOptional, IsString, Length, Max, Min } from 'class-validator'; +import { BooleanEnum } from '@utils/boolean.enum'; +import Int from '@common/decorator/int/int.descrator'; +import ChangeCase, { CaseType } from '@common/decorator/change-case/change-case.decorator'; + +export class GetPacAuthRoleAllDto extends GetDto { + @ApiProperty({ + description: '角色', + type: String, + example: '管理员', + required: false, + minLength: 1, + maxLength: 128, + }) + @Trim() + @IsString({ message: '字典信息应为字符串格式!' }) + @Length(0, 128, { message: '请将字典信息长度控制在1到128位之间!' }) + @IsOptional() + readonly roleInfo?: string; + + @ApiProperty({ + description: '角色类型,来自于字典', + type: String, + example: '0', + required: true, + minLength: 19, + maxLength: 19, + }) + @Trim() + @IsString({ message: '角色类型格式不正确!' }) + @Length(19, 19, { message: '角色类型格式不正确!' }) + readonly roleType: string; + + @ApiProperty({ + description: '是否属于PAC', + type: BooleanEnum, + enum: BooleanEnum, + example: 0, + required: false, + }) + @Trim() + @IsEnum(BooleanEnum, { message: 'root参数格式错误' }) + @IsOptional() + readonly root: BooleanEnum; + + @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; + + @ApiProperty({ + description: '字典层级id', + type: Number, + example: 0, + required: false, + minimum: 0, + maximum: 100, + }) + @Trim() + @IsString({ message: '字典层级id应为字符串格式!' }) + @Length(1, 20, { message: '字典层级id格式错误!' }) + @IsOptional() + readonly hierarchy?: string; +} + +export class PacAuthRoleTargetListDto { + @ApiProperty({ + description: '是否查找树结构', + type: BooleanEnum, + enum: BooleanEnum, + example: 0, + required: false, + }) + @Trim() + @IsEnum(BooleanEnum, { + message: '查找树结构数据错误', + }) + @IsOptional() + readonly isTree: BooleanEnum; +} diff --git a/src/application/auth-role/dto/update-auth-role.dto.ts b/src/application/auth-role/dto/update-auth-role.dto.ts new file mode 100644 index 0000000..40cc711 --- /dev/null +++ b/src/application/auth-role/dto/update-auth-role.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/swagger'; +import { CreateAuthRoleDto } from './create-auth-role.dto'; + +export class UpdateAuthRoleDto extends PartialType(CreateAuthRoleDto) {} diff --git a/src/application/core-dict/dto/create-core-dict.dto.ts b/src/application/core-dict/dto/create-core-dict.dto.ts index 0b875c8..5805765 100644 --- a/src/application/core-dict/dto/create-core-dict.dto.ts +++ b/src/application/core-dict/dto/create-core-dict.dto.ts @@ -2,6 +2,9 @@ import { ApiProperty } from '@nestjs/swagger'; import { IsEnum, IsInt, IsOptional, IsString, Length, Max, Min } from 'class-validator'; import Trim from '@common/decorator/trim/trim.decorator'; import { BooleanEnum } from '@utils/boolean.enum'; +import ChangeCase, { + CaseType +} from "@common/decorator/change-case/change-case.decorator"; export class CreateCoreDictDto { @ApiProperty({ @@ -26,6 +29,7 @@ export class CreateCoreDictDto { maxLength: 32, }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '字典标志应为字符串格式!' }) @Length(1, 32, { message: '请将字典标志长度控制在1到32位之间!' }) readonly dictKey: string; @@ -95,7 +99,7 @@ export class CreateCoreDictDto { required: false, }) @Trim() - @IsEnum(BooleanEnum, { message: 'ownOfPac参数格式错误' }) + @IsEnum(BooleanEnum, { message: 'root参数格式错误' }) @IsOptional() readonly root?: BooleanEnum = BooleanEnum.FALSE; @@ -128,6 +132,7 @@ export class CreateCoreDictDto { maxLength: 16, }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '服务标识应为字符串格式!' }) @Length(2, 16, { message: '请将服务标识长度控制在2到16位之间!' }) @IsOptional() diff --git a/src/application/core-dict/dto/get-core-dict.dto.ts b/src/application/core-dict/dto/get-core-dict.dto.ts index 4f21287..b091161 100644 --- a/src/application/core-dict/dto/get-core-dict.dto.ts +++ b/src/application/core-dict/dto/get-core-dict.dto.ts @@ -17,6 +17,7 @@ import Trim from '@common/decorator/trim/trim.decorator'; import { IsEnum, IsInt, IsOptional, IsString, Length, Max, Min } from 'class-validator'; import { BooleanEnum } from '@utils/boolean.enum'; import Int from '@common/decorator/int/int.descrator'; +import ChangeCase, { CaseType } from '@common/decorator/change-case/change-case.decorator'; export class GetPacCoreDictAllDto extends GetDto { @ApiProperty({ @@ -33,13 +34,17 @@ export class GetPacCoreDictAllDto extends GetDto { @IsOptional() readonly dictInfo?: string; + @ApiProperty({ description: '字典类型', type: String, - example: 0, + example: '0', required: false, + minLength: 19, + maxLength: 19, }) @Trim() + @Length(19, 19, { message: '字典类型格式不正确!' }) @IsString({ message: '字典类型应为字符串格式!' }) @IsOptional() readonly dictType?: string; @@ -52,7 +57,7 @@ export class GetPacCoreDictAllDto extends GetDto { required: false, }) @Trim() - @IsEnum(BooleanEnum, { message: 'ownOfPac参数格式错误' }) + @IsEnum(BooleanEnum, { message: 'root参数格式错误' }) @IsOptional() readonly root: BooleanEnum; @@ -65,6 +70,7 @@ export class GetPacCoreDictAllDto extends GetDto { maxLength: 16, }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '服务标识应为字符串格式!' }) @Length(2, 16, { message: '请将服务标识长度控制在2到16位之间!' }) @IsOptional() diff --git a/src/application/core-env/dto/create-core-env.dto.ts b/src/application/core-env/dto/create-core-env.dto.ts index edd9215..3193951 100644 --- a/src/application/core-env/dto/create-core-env.dto.ts +++ b/src/application/core-env/dto/create-core-env.dto.ts @@ -125,6 +125,7 @@ export class CreateCoreEnvDto { maxLength: 16, }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '服务标识应为字符串格式!' }) @Length(2, 16, { message: '请将服务标识长度控制在2到16位之间!' }) @IsOptional() diff --git a/src/application/core-env/dto/get-core-env.dto.ts b/src/application/core-env/dto/get-core-env.dto.ts index ab80701..19b5cbe 100644 --- a/src/application/core-env/dto/get-core-env.dto.ts +++ b/src/application/core-env/dto/get-core-env.dto.ts @@ -43,9 +43,9 @@ export class GetCoreEnvDTO extends GetDto { required: false, }) @Trim() - @IsEnum(BooleanEnum, { message: 'ownOfPac参数格式错误' }) + @IsEnum(BooleanEnum, { message: 'root参数格式错误' }) @IsOptional() - readonly ownOfPac: BooleanEnum; + readonly root: BooleanEnum; @ApiProperty({ description: '服务的唯一标识', @@ -56,6 +56,7 @@ export class GetCoreEnvDTO extends GetDto { maxLength: 16, }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '服务标识应为字符串格式!' }) @Length(2, 16, { message: '请将服务标识长度控制在2到16位之间!' }) @IsOptional() diff --git a/src/application/core-menu/core-menu.service.ts b/src/application/core-menu/core-menu.service.ts index d40b350..c724c7e 100644 --- a/src/application/core-menu/core-menu.service.ts +++ b/src/application/core-menu/core-menu.service.ts @@ -178,7 +178,7 @@ export class CoreMenuService { .where(eq(pacCoreMenu.menuId as any, menuId)); } - // 查菜单数据 + // DB 查菜单数据 private getMenuData(data: GetPacCoreMenuAllDto, pacInfo: PacInfoType, selectData = undefined) { // ! 定义基础查询函数 // 启用动态查询模式 $dynamic diff --git a/src/application/core-menu/dto/create-core-menu.dto.ts b/src/application/core-menu/dto/create-core-menu.dto.ts index 30105ad..1e5c972 100644 --- a/src/application/core-menu/dto/create-core-menu.dto.ts +++ b/src/application/core-menu/dto/create-core-menu.dto.ts @@ -2,6 +2,9 @@ import { ApiProperty } from '@nestjs/swagger'; import Trim from '@common/decorator/trim/trim.decorator'; import { IsEnum, IsInt, IsOptional, IsString, Length, Max, Min } from 'class-validator'; import { BooleanEnum } from '@utils/boolean.enum'; +import ChangeCase, { + CaseType +} from "@common/decorator/change-case/change-case.decorator"; export class CreateCoreMenuDto { @ApiProperty({ @@ -178,6 +181,7 @@ export class CreateCoreMenuDto { maxLength: 16, }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '服务标识应为字符串格式!' }) @Length(2, 16, { message: '请将服务标识长度控制在2到16位之间!' }) @IsOptional() diff --git a/src/application/core-menu/dto/get-core-menu.dto.ts b/src/application/core-menu/dto/get-core-menu.dto.ts index adff35d..6f12f1a 100644 --- a/src/application/core-menu/dto/get-core-menu.dto.ts +++ b/src/application/core-menu/dto/get-core-menu.dto.ts @@ -17,6 +17,9 @@ import Trim from '@common/decorator/trim/trim.decorator'; import { IsEnum, IsInt, IsOptional, IsString, Length, Max, Min } from 'class-validator'; import { BooleanEnum } from '@utils/boolean.enum'; import Int from '@common/decorator/int/int.descrator'; +import ChangeCase, { + CaseType +} from "@common/decorator/change-case/change-case.decorator"; export class GetPacCoreMenuAllDto extends GetDto { @ApiProperty({ @@ -56,6 +59,7 @@ export class GetPacCoreMenuAllDto extends GetDto { maxLength: 16, }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '服务标识应为字符串格式!' }) @Length(2, 16, { message: '请将服务标识长度控制在2到16位之间!' }) @IsOptional() diff --git a/src/application/core-service/dto/create-core-service.dto.ts b/src/application/core-service/dto/create-core-service.dto.ts index 685e075..5c79ed6 100644 --- a/src/application/core-service/dto/create-core-service.dto.ts +++ b/src/application/core-service/dto/create-core-service.dto.ts @@ -1,6 +1,9 @@ import { IsOptional, IsString, Length } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; import Trim from '@common/decorator/trim/trim.decorator'; +import ChangeCase, { + CaseType +} from "@common/decorator/change-case/change-case.decorator"; export class CreateCoreServiceDto { @ApiProperty({ @@ -17,6 +20,7 @@ export class CreateCoreServiceDto { // minItems: 1, // 数组属性的最小项目数 }) @Trim() + @ChangeCase(CaseType.constant) @IsString({ message: '服务标识应为字符串格式!' }) @Length(2, 16, { message: '请将服务标识长度控制在2到16位之间!' }) readonly serviceKey: string; 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 53fc33b..b765ad9 100644 --- a/src/entities/schema.ts +++ b/src/entities/schema.ts @@ -1,5 +1,6 @@ import { mysqlTable, mysqlSchema, AnyMySqlColumn, primaryKey, unique, int, varchar, datetime } from 'drizzle-orm/mysql-core'; import { sql } from 'drizzle-orm'; + import { bigintString } from '@entities/customType'; const bigint = bigintString; export const pacAuthDept = mysqlTable( @@ -35,19 +36,13 @@ export const pacAuthLinkRoleDept = mysqlTable( 'pac_auth_link_role_dept', { index: int('index').autoincrement().notNull(), - roleId: int('role_id').notNull(), - deptId: int('dept_id').notNull(), - scopeId: int('scope_id').notNull(), - createby: int('createby').notNull(), + roleId: bigint('role_id', { mode: 'number' }).notNull(), + deptId: bigint('dept_id', { mode: 'number' }).notNull(), + createby: bigint('createby', { mode: 'number' }).notNull(), createtime: datetime('createtime', { mode: 'string' }).notNull(), - updateby: int('updateby'), - updatetime: datetime('updatetime', { mode: 'string' }), - deleteby: int('deleteby'), - deletetime: datetime('deletetime', { mode: 'string' }), }, (table) => { return { - pacAuthLinkRoleDeptScopeId: primaryKey({ columns: [table.scopeId], name: 'pac_auth_link_role_dept_scope_id' }), pacIndex: unique('pac_index').on(table.index), }; }, @@ -57,14 +52,10 @@ export const pacAuthLinkRoleMenu = mysqlTable( 'pac_auth_link_role_menu', { index: int('index').autoincrement().notNull(), - roleId: int('role_id').notNull(), - menuId: int('menu_id').notNull(), - createby: int('createby').notNull(), + roleId: bigint('role_id', { mode: 'number' }).notNull(), + menuId: bigint('menu_id', { mode: 'number' }).notNull(), + createby: bigint('createby', { mode: 'number' }).notNull(), createtime: datetime('createtime', { mode: 'string' }).notNull(), - updateby: int('updateby'), - updatetime: datetime('updatetime', { mode: 'string' }), - deleteby: int('deleteby'), - deletetime: datetime('deletetime', { mode: 'string' }), }, (table) => { return { @@ -78,14 +69,10 @@ export const pacAuthLinkUserDept = mysqlTable( 'pac_auth_link_user_dept', { index: int('index').autoincrement().notNull(), - userId: int('user_id').notNull(), - deptId: int('dept_id').notNull(), - createby: int('createby').notNull(), + userId: bigint('user_id', { mode: 'number' }).notNull(), + deptId: bigint('dept_id', { mode: 'number' }).notNull(), + createby: bigint('createby', { mode: 'number' }).notNull(), createtime: datetime('createtime', { mode: 'string' }).notNull(), - updateby: int('updateby'), - updatetime: datetime('updatetime', { mode: 'string' }), - deleteby: int('deleteby'), - deletetime: datetime('deletetime', { mode: 'string' }), }, (table) => { return { @@ -99,14 +86,10 @@ export const pacAuthLinkUserPost = mysqlTable( 'pac_auth_link_user_post', { index: int('index').autoincrement().notNull(), - userId: int('user_id').notNull(), - postId: int('post_id').notNull(), - createby: int('createby').notNull(), + userId: bigint('user_id', { mode: 'number' }).notNull(), + postId: bigint('post_id', { mode: 'number' }).notNull(), + createby: bigint('createby', { mode: 'number' }).notNull(), createtime: datetime('createtime', { mode: 'string' }).notNull(), - updateby: int('updateby'), - updatetime: datetime('updatetime', { mode: 'string' }), - deleteby: int('deleteby'), - deletetime: datetime('deletetime', { mode: 'string' }), }, (table) => { return { @@ -120,14 +103,10 @@ export const pacAuthLinkUserRole = mysqlTable( 'pac_auth_link_user_role', { index: int('index').autoincrement().notNull(), - userId: int('user_id').notNull(), - roleId: int('role_id').notNull(), - createby: int('createby').notNull(), + userId: bigint('user_id', { mode: 'number' }).notNull(), + roleId: bigint('role_id', { mode: 'number' }).notNull(), + createby: bigint('createby', { mode: 'number' }).notNull(), createtime: datetime('createtime', { mode: 'string' }).notNull(), - updateby: int('updateby'), - updatetime: datetime('updatetime', { mode: 'string' }), - deleteby: int('deleteby'), - deletetime: datetime('deletetime', { mode: 'string' }), }, (table) => { return { @@ -165,7 +144,7 @@ export const pacAuthPost = mysqlTable( export const pacAuthRole = mysqlTable( 'pac_auth_role', { - index: int('index').notNull(), + index: int('index').autoincrement().notNull(), roleId: bigint('role_id', { mode: 'number' }).notNull(), pid: bigint('pid', { mode: 'number' }).notNull(), roleName: varchar('role_name', { length: 255 }).notNull(), @@ -173,6 +152,7 @@ export const pacAuthRole = mysqlTable( roleDesc: varchar('role_desc', { length: 255 }), roleType: bigint('role_type', { mode: 'number' }).notNull(), deptScope: int('dept_scope').default(1).notNull(), + haveChildren: int('have_children').default(0).notNull(), root: int('root').default(0).notNull(), orderNum: int('order_num').default(0).notNull(), status: int('status').default(0).notNull(),