Skip to content

Commit b0f675f

Browse files
authored
Delete the model redundancy level field (#518)
1 parent 6d44f80 commit b0f675f

File tree

6 files changed

+44
-54
lines changed

6 files changed

+44
-54
lines changed

backend/app/admin/model/dept.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class Dept(Base):
1616

1717
id: Mapped[id_key] = mapped_column(init=False)
1818
name: Mapped[str] = mapped_column(String(50), comment='部门名称')
19-
level: Mapped[int] = mapped_column(default=0, comment='部门层级')
2019
sort: Mapped[int] = mapped_column(default=0, comment='排序')
2120
leader: Mapped[str | None] = mapped_column(String(20), default=None, comment='负责人')
2221
phone: Mapped[str | None] = mapped_column(String(11), default=None, comment='手机')

backend/app/admin/model/menu.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Menu(Base):
1919
id: Mapped[id_key] = mapped_column(init=False)
2020
title: Mapped[str] = mapped_column(String(50), comment='菜单标题')
2121
name: Mapped[str] = mapped_column(String(50), comment='菜单名称')
22-
level: Mapped[int] = mapped_column(default=0, comment='菜单层级')
2322
sort: Mapped[int] = mapped_column(default=0, comment='排序')
2423
icon: Mapped[str | None] = mapped_column(String(100), default=None, comment='菜单图标')
2524
path: Mapped[str | None] = mapped_column(String(200), default=None, comment='路由地址')

backend/sql/mysql/create_tables.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ create table sys_dept
7474
id int auto_increment comment '主键id'
7575
primary key,
7676
name varchar(50) not null comment '部门名称',
77-
level int not null comment '部门层级',
7877
sort int not null comment '排序',
7978
leader varchar(20) null comment '负责人',
8079
phone varchar(11) null comment '手机',
@@ -218,7 +217,6 @@ create table sys_menu
218217
primary key,
219218
title varchar(50) not null comment '菜单标题',
220219
name varchar(50) not null comment '菜单名称',
221-
level int not null comment '菜单层级',
222220
sort int not null comment '排序',
223221
icon varchar(100) null comment '菜单图标',
224222
path varchar(200) null comment '路由地址',

backend/sql/mysql/init_test_data.sql

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
insert into sys_dept (id, name, level, sort, leader, phone, email, status, del_flag, parent_id, created_time, updated_time)
2-
values (1, 'test', 0, 0, null, null, null, 1, 0, null, '2023-06-26 17:13:45', null);
1+
insert into sys_dept (id, name, sort, leader, phone, email, status, del_flag, parent_id, created_time, updated_time)
2+
values (1, 'test', 0, null, null, null, 1, 0, null, '2023-06-26 17:13:45', null);
33

44
insert into sys_api (id, name, method, path, remark, created_time, updated_time)
55
values (1, '创建API', 'POST', '/api/v1/apis', null, '2024-02-02 11:29:47', null),
66
(2, '删除API', 'DELETE', '/api/v1/apis', null, '2024-02-02 11:31:32', null),
77
(3, '编辑API', 'PUT', '/api/v1/apis/{pk}', null, '2024-02-02 11:32:22', null);
88

99
insert into sys_menu (id, title, name, level, sort, icon, path, menu_type, component, perms, status, display, cache, remark, parent_id, created_time, updated_time)
10-
values (1, '测试', 'test', 0, 0, '', null, 0, null, null, 0, 0, 1, null, null, '2023-07-27 19:14:10', null),
11-
(2, '仪表盘', 'dashboard', 0, 0, 'IconDashboard', 'dashboard', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:15:45', null),
12-
(3, '工作台', 'Workplace', 0, 0, null, 'workplace', 1, '/dashboard/workplace/index.vue', null, 1, 1, 1, null, 2, '2023-07-27 19:17:59', null),
13-
(4, '系统管理', 'admin', 0, 0, 'IconSettings', 'admin', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:23:00', null),
14-
(5, '部门管理', 'SysDept', 0, 0, null, 'sys-dept', 1, '/admin/dept/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:23:42', null),
15-
(6, '用户管理', 'SysUser', 0, 0, null, 'sys-user', 1, '/admin/user/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:13', null),
16-
(7, '角色管理', 'SysRole', 0, 0, null, 'sys-role', 1, '/admin/role/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:45', null),
17-
(8, '菜单管理', 'SysMenu', 0, 0, null, 'sys-menu', 1, '/admin/menu/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:45:29', null),
18-
(9, 'API 管理', 'SysApi', 0, 0, null, 'sys-api', 1, '/admin/api/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
19-
(10, '数据规则管理', 'SysDataRule', 0, 0, null, 'sys-data-rule', 1, '/admin/data-rule/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
20-
(11, '系统自动化', 'automation', 0, 0, 'IconCodeSquare', 'automation', 0, null, null, 1, 1, 1, null, null, '2024-07-27 02:06:20', '2024-07-27 02:18:52'),
21-
(12, '代码生成', 'CodeGenerator', 0, 0, null, 'code-generator', 1, '/automation/generator/index.vue', null, 1, 1, 1, null, 11, '2024-07-27 12:24:54', null),
22-
(13, '系统监控', 'monitor', 0, 0, 'IconComputer', 'monitor', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:27:08', null),
23-
(14, 'Redis 监控', 'Redis', 0, 0, null, 'redis', 1, '/monitor/redis/index.vue', 'sys:monitor:redis', 1, 1, 1, null, 13, '2023-07-27 19:28:03', null),
24-
(15, '服务器监控', 'Server', 0, 0, null, 'server', 1, '/monitor/server/index.vue', 'sys:monitor:server', 1, 1, 1, null, 13, '2023-07-27 19:28:29', null),
25-
(16, '日志', 'log', 0, 0, 'IconBug', 'log', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:19:59', null),
26-
(17, '登录日志', 'Login', 0, 0, null, 'login', 1, '/log/login/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:20:56', null),
27-
(18, '操作日志', 'Opera', 0, 0, null, 'opera', 1, '/log/opera/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:21:28', null),
28-
(19, '官网', 'site', 0, 998, 'IconComputer', 'https://fastapi-practices.github.io/fastapi_best_architecture_docs/', 1, null, null, 1, 1, 1, null, null, '2023-07-27 19:22:24', null),
29-
(20, '赞助', 'sponsor', 0, 999, 'IconFire', 'https://wu-clan.github.io/sponsor/', 1, null, null, 1, 1, 1, null, null, '2024-07-27 12:39:57', null);
10+
values (1, '测试', 'test', 0, '', null, 0, null, null, 0, 0, 1, null, null, '2023-07-27 19:14:10', null),
11+
(2, '仪表盘', 'dashboard', 0, 'IconDashboard', 'dashboard', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:15:45', null),
12+
(3, '工作台', 'Workplace', 0, null, 'workplace', 1, '/dashboard/workplace/index.vue', null, 1, 1, 1, null, 2, '2023-07-27 19:17:59', null),
13+
(4, '系统管理', 'admin', 0, 'IconSettings', 'admin', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:23:00', null),
14+
(5, '部门管理', 'SysDept', 0, null, 'sys-dept', 1, '/admin/dept/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:23:42', null),
15+
(6, '用户管理', 'SysUser', 0, null, 'sys-user', 1, '/admin/user/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:13', null),
16+
(7, '角色管理', 'SysRole', 0, null, 'sys-role', 1, '/admin/role/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:45', null),
17+
(8, '菜单管理', 'SysMenu', 0, null, 'sys-menu', 1, '/admin/menu/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:45:29', null),
18+
(9, 'API 管理', 'SysApi', 0, null, 'sys-api', 1, '/admin/api/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
19+
(10, '数据规则管理', 'SysDataRule', 0, null, 'sys-data-rule', 1, '/admin/data-rule/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
20+
(11, '系统自动化', 'automation', 0, 'IconCodeSquare', 'automation', 0, null, null, 1, 1, 1, null, null, '2024-07-27 02:06:20', '2024-07-27 02:18:52'),
21+
(12, '代码生成', 'CodeGenerator', 0, null, 'code-generator', 1, '/automation/generator/index.vue', null, 1, 1, 1, null, 11, '2024-07-27 12:24:54', null),
22+
(13, '系统监控', 'monitor', 0, 'IconComputer', 'monitor', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:27:08', null),
23+
(14, 'Redis 监控', 'Redis', 0, null, 'redis', 1, '/monitor/redis/index.vue', 'sys:monitor:redis', 1, 1, 1, null, 13, '2023-07-27 19:28:03', null),
24+
(15, '服务器监控', 'Server', 0, null, 'server', 1, '/monitor/server/index.vue', 'sys:monitor:server', 1, 1, 1, null, 13, '2023-07-27 19:28:29', null),
25+
(16, '日志', 'log', 0, 'IconBug', 'log', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:19:59', null),
26+
(17, '登录日志', 'Login', 0, null, 'login', 1, '/log/login/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:20:56', null),
27+
(18, '操作日志', 'Opera', 0, null, 'opera', 1, '/log/opera/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:21:28', null),
28+
(19, '官网', 'site', 998, 'IconComputer', 'https://fastapi-practices.github.io/fastapi_best_architecture_docs/', 1, null, null, 1, 1, 1, null, null, '2023-07-27 19:22:24', null),
29+
(20, '赞助', 'sponsor', 999, 'IconFire', 'https://wu-clan.github.io/sponsor/', 1, null, null, 1, 1, 1, null, null, '2024-07-27 12:39:57', null);
3030

3131
insert into sys_role (id, name, status, remark, created_time, updated_time)
3232
values (1, 'test', 1, null, '2023-06-26 17:13:45', null);

backend/sql/postgresql/create_tables.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ create table sys_dept
131131
id serial
132132
primary key,
133133
name varchar(50) not null,
134-
level integer not null,
135134
sort integer not null,
136135
leader varchar(20),
137136
phone varchar(11),
@@ -149,8 +148,6 @@ comment on column sys_dept.id is '主键id';
149148

150149
comment on column sys_dept.name is '部门名称';
151150

152-
comment on column sys_dept.level is '部门层级';
153-
154151
comment on column sys_dept.sort is '排序';
155152

156153
comment on column sys_dept.leader is '负责人';
@@ -265,7 +262,6 @@ create table sys_menu
265262
primary key,
266263
title varchar(50) not null,
267264
name varchar(50) not null,
268-
level integer not null,
269265
sort integer not null,
270266
icon varchar(100),
271267
path varchar(200),
@@ -289,8 +285,6 @@ comment on column sys_menu.title is '菜单标题';
289285

290286
comment on column sys_menu.name is '菜单名称';
291287

292-
comment on column sys_menu.level is '菜单层级';
293-
294288
comment on column sys_menu.sort is '排序';
295289

296290
comment on column sys_menu.icon is '菜单图标';

backend/sql/postgresql/init_test_data.sql

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
insert into sys_dept (id, name, level, sort, leader, phone, email, status, del_flag, parent_id, created_time, updated_time)
2-
values (1, 'test', 0, 0, null, null, null, 1, 0, null, '2023-06-26 17:13:45', null);
1+
insert into sys_dept (id, name, sort, leader, phone, email, status, del_flag, parent_id, created_time, updated_time)
2+
values (1, 'test', 0, null, null, null, 1, 0, null, '2023-06-26 17:13:45', null);
33

44
insert into sys_api (id, name, method, path, remark, created_time, updated_time)
55
values (1, '创建API', 'POST', '/api/v1/apis', null, '2024-02-02 11:29:47', null),
66
(2, '删除API', 'DELETE', '/api/v1/apis', null, '2024-02-02 11:31:32', null),
77
(3, '编辑API', 'PUT', '/api/v1/apis/{pk}', null, '2024-02-02 11:32:22', null);
88

99
insert into sys_menu (id, title, name, level, sort, icon, path, menu_type, component, perms, status, display, cache, remark, parent_id, created_time, updated_time)
10-
values (1, '测试', 'test', 0, 0, '', null, 0, null, null, 0, 0, 1, null, null, '2023-07-27 19:14:10', null),
11-
(2, '仪表盘', 'dashboard', 0, 0, 'IconDashboard', 'dashboard', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:15:45', null),
12-
(3, '工作台', 'Workplace', 0, 0, null, 'workplace', 1, '/dashboard/workplace/index.vue', null, 1, 1, 1, null, 2, '2023-07-27 19:17:59', null),
13-
(4, '系统管理', 'admin', 0, 0, 'IconSettings', 'admin', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:23:00', null),
14-
(5, '部门管理', 'SysDept', 0, 0, null, 'sys-dept', 1, '/admin/dept/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:23:42', null),
15-
(6, '用户管理', 'SysUser', 0, 0, null, 'sys-user', 1, '/admin/user/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:13', null),
16-
(7, '角色管理', 'SysRole', 0, 0, null, 'sys-role', 1, '/admin/role/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:45', null),
17-
(8, '菜单管理', 'SysMenu', 0, 0, null, 'sys-menu', 1, '/admin/menu/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:45:29', null),
18-
(9, 'API 管理', 'SysApi', 0, 0, null, 'sys-api', 1, '/admin/api/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
19-
(10, '数据规则管理', 'SysDataRule', 0, 0, null, 'sys-data-rule', 1, '/admin/data-rule/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
20-
(11, '系统自动化', 'automation', 0, 0, 'IconCodeSquare', 'automation', 0, null, null, 1, 1, 1, null, null, '2024-07-27 02:06:20', '2024-07-27 02:18:52'),
21-
(12, '代码生成', 'CodeGenerator', 0, 0, null, 'code-generator', 1, '/automation/generator/index.vue', null, 1, 1, 1, null, 11, '2024-07-27 12:24:54', null),
22-
(13, '系统监控', 'monitor', 0, 0, 'IconComputer', 'monitor', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:27:08', null),
23-
(14, 'Redis 监控', 'Redis', 0, 0, null, 'redis', 1, '/monitor/redis/index.vue', 'sys:monitor:redis', 1, 1, 1, null, 13, '2023-07-27 19:28:03', null),
24-
(15, '服务器监控', 'Server', 0, 0, null, 'server', 1, '/monitor/server/index.vue', 'sys:monitor:server', 1, 1, 1, null, 13, '2023-07-27 19:28:29', null),
25-
(16, '日志', 'log', 0, 0, 'IconBug', 'log', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:19:59', null),
26-
(17, '登录日志', 'Login', 0, 0, null, 'login', 1, '/log/login/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:20:56', null),
27-
(18, '操作日志', 'Opera', 0, 0, null, 'opera', 1, '/log/opera/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:21:28', null),
28-
(19, '官网', 'site', 0, 998, 'IconComputer', 'https://fastapi-practices.github.io/fastapi_best_architecture_docs/', 1, null, null, 1, 1, 1, null, null, '2023-07-27 19:22:24', null),
29-
(20, '赞助', 'sponsor', 0, 999, 'IconFire', 'https://wu-clan.github.io/sponsor/', 1, null, null, 1, 1, 1, null, null, '2024-07-27 12:39:57', null);
10+
values (1, '测试', 'test', 0, '', null, 0, null, null, 0, 0, 1, null, null, '2023-07-27 19:14:10', null),
11+
(2, '仪表盘', 'dashboard', 0, 'IconDashboard', 'dashboard', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:15:45', null),
12+
(3, '工作台', 'Workplace', 0, null, 'workplace', 1, '/dashboard/workplace/index.vue', null, 1, 1, 1, null, 2, '2023-07-27 19:17:59', null),
13+
(4, '系统管理', 'admin', 0, 'IconSettings', 'admin', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:23:00', null),
14+
(5, '部门管理', 'SysDept', 0, null, 'sys-dept', 1, '/admin/dept/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:23:42', null),
15+
(6, '用户管理', 'SysUser', 0, null, 'sys-user', 1, '/admin/user/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:13', null),
16+
(7, '角色管理', 'SysRole', 0, null, 'sys-role', 1, '/admin/role/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:25:45', null),
17+
(8, '菜单管理', 'SysMenu', 0, null, 'sys-menu', 1, '/admin/menu/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:45:29', null),
18+
(9, 'API 管理', 'SysApi', 0, null, 'sys-api', 1, '/admin/api/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
19+
(10, '数据规则管理', 'SysDataRule', 0, null, 'sys-data-rule', 1, '/admin/data-rule/index.vue', null, 1, 1, 1, null, 4, '2023-07-27 19:24:12', null),
20+
(11, '系统自动化', 'automation', 0, 'IconCodeSquare', 'automation', 0, null, null, 1, 1, 1, null, null, '2024-07-27 02:06:20', '2024-07-27 02:18:52'),
21+
(12, '代码生成', 'CodeGenerator', 0, null, 'code-generator', 1, '/automation/generator/index.vue', null, 1, 1, 1, null, 11, '2024-07-27 12:24:54', null),
22+
(13, '系统监控', 'monitor', 0, 'IconComputer', 'monitor', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:27:08', null),
23+
(14, 'Redis 监控', 'Redis', 0, null, 'redis', 1, '/monitor/redis/index.vue', 'sys:monitor:redis', 1, 1, 1, null, 13, '2023-07-27 19:28:03', null),
24+
(15, '服务器监控', 'Server', 0, null, 'server', 1, '/monitor/server/index.vue', 'sys:monitor:server', 1, 1, 1, null, 13, '2023-07-27 19:28:29', null),
25+
(16, '日志', 'log', 0, 'IconBug', 'log', 0, null, null, 1, 1, 1, null, null, '2023-07-27 19:19:59', null),
26+
(17, '登录日志', 'Login', 0, null, 'login', 1, '/log/login/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:20:56', null),
27+
(18, '操作日志', 'Opera', 0, null, 'opera', 1, '/log/opera/index.vue', null, 1, 1, 1, null, 16, '2023-07-27 19:21:28', null),
28+
(19, '官网', 'site', 998, 'IconComputer', 'https://fastapi-practices.github.io/fastapi_best_architecture_docs/', 1, null, null, 1, 1, 1, null, null, '2023-07-27 19:22:24', null),
29+
(20, '赞助', 'sponsor', 999, 'IconFire', 'https://wu-clan.github.io/sponsor/', 1, null, null, 1, 1, 1, null, null, '2024-07-27 12:39:57', null);
3030

3131
insert into sys_role (id, name, status, remark, created_time, updated_time)
3232
values (1, 'test', 1, null, '2023-06-26 17:13:45', null);

0 commit comments

Comments
 (0)