Skip to content

Commit 95b55c4

Browse files
committed
feat: add tanant API
1 parent 2b6df2b commit 95b55c4

File tree

5 files changed

+53
-8
lines changed

5 files changed

+53
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (1, 'Tinybuilder_Admin', '超级管理员', '1', '2025-10-29 01:37:10', '1', '2025-10-29 01:37:10');
2+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (2, 'Tinybuilder_Tenant_Admin', '组织管理员', '1', '2025-10-29 01:37:36', '1', '2025-10-29 01:37:36');
3+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (3, 'Tinybuilder_Platform_Admin', '设计器管理员', '1', '2025-10-29 01:38:00', '1', '2025-10-29 01:38:00');
4+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (4, 'Tinybuilder_App_Admin', '应用管理员', '1', '2025-10-29 01:39:06', '1', '2025-10-29 01:39:06');
5+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (5, 'Tinybuilder_App_Developer', '应用开发者', '1', '2025-10-29 01:39:26', '1', '2025-10-29 01:39:26');
6+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (6, 'Guest', '游客', '1', '2025-10-29 01:39:38', '1', '2025-10-29 01:39:38');

app/src/main/resources/sql/mysql/init_data_2025_1023.sql

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,4 @@ INSERT INTO `t_business_category` (`id`, `code`, `name`, `business_group`, `tena
1010
INSERT INTO `t_business_category` (`id`, `code`, `name`, `business_group`, `tenant_id`, `renter_id`, `site_id`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (10, 'constructionIndustry', '建筑行业', '行业', '1', '1', '1', '1', '2025-10-14 00:26:27', '1', '2025-10-14 00:26:27');
1111
INSERT INTO `t_business_category` (`id`, `code`, `name`, `business_group`, `tenant_id`, `renter_id`, `site_id`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (11, 'governmentAgency', '政府机构', '行业', '1', '1', '1', '1', '2025-10-14 00:26:27', '1', '2025-10-14 00:26:27');
1212
INSERT INTO `t_business_category` (`id`, `code`, `name`, `business_group`, `tenant_id`, `renter_id`, `site_id`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (12, 'Internet', '互联网', '行业', '1', '1', '1', '1', '2025-10-14 00:26:27', '1', '2025-10-14 00:26:27');
13-
INSERT INTO `t_business_category` (`id`, `code`, `name`, `business_group`, `tenant_id`, `renter_id`, `site_id`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (13, 'serviceTraining', '服务培训', '行业', '1', '1', '1', '1', '2025-10-14 00:26:27', '1', '2025-10-14 00:26:27');
14-
15-
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (1, 'Tinybuilder_Admin', '超级管理员', '1', '2025-10-29 01:37:10', '1', '2025-10-29 01:37:10');
16-
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (2, 'Tinybuilder_Tenant_Admin', '组织管理员', '1', '2025-10-29 01:37:36', '1', '2025-10-29 01:37:36');
17-
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (3, 'Tinybuilder_Platform_Admin', '设计器管理员', '1', '2025-10-29 01:38:00', '1', '2025-10-29 01:38:00');
18-
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (4, 'Tinybuilder_App_Admin', '应用管理员', '1', '2025-10-29 01:39:06', '1', '2025-10-29 01:39:06');
19-
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (5, 'Tinybuilder_App_Developer', '应用开发者', '1', '2025-10-29 01:39:26', '1', '2025-10-29 01:39:26');
20-
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (6, 'Guest', '游客', '1', '2025-10-29 01:39:38', '1', '2025-10-29 01:39:38');
13+
INSERT INTO `t_business_category` (`id`, `code`, `name`, `business_group`, `tenant_id`, `renter_id`, `site_id`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (13, 'serviceTraining', '服务培训', '行业', '1', '1', '1', '1', '2025-10-14 00:26:27', '1', '2025-10-14 00:26:27');
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (1, 'Tinybuilder_Admin', '超级管理员', '1', '2025-10-29 01:37:10', '1', '2025-10-29 01:37:10');
2+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (2, 'Tinybuilder_Tenant_Admin', '组织管理员', '1', '2025-10-29 01:37:36', '1', '2025-10-29 01:37:36');
3+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (3, 'Tinybuilder_Platform_Admin', '设计器管理员', '1', '2025-10-29 01:38:00', '1', '2025-10-29 01:38:00');
4+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (4, 'Tinybuilder_App_Admin', '应用管理员', '1', '2025-10-29 01:39:06', '1', '2025-10-29 01:39:06');
5+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (5, 'Tinybuilder_App_Developer', '应用开发者', '1', '2025-10-29 01:39:26', '1', '2025-10-29 01:39:26');
6+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (6, 'Guest', '游客', '1', '2025-10-29 01:39:38', '1', '2025-10-29 01:39:38');
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
drop table if exists `t_permission_role`;
2+
3+
create table `t_permission_role`
4+
(
5+
`id` int not null auto_increment comment '主键id',
6+
`name` varchar(255) not null comment '名称',
7+
`description` varchar(2000) comment '描述',
8+
`created_by` varchar(60) not null comment '创建人',
9+
`created_time` timestamp not null default current_timestamp comment '创建时间',
10+
`last_updated_by` varchar(60) not null comment '最后修改人',
11+
`last_updated_time` timestamp not null default current_timestamp comment '更新时间',
12+
primary key (`id`) using btree,
13+
unique index `u_idx_permission_role` (`name`) using btree
14+
) engine = innodb comment = '';
15+
16+
drop table if exists `r_auth_users_units_roles`;
17+
18+
create table `r_auth_users_units_roles`
19+
(
20+
`id` int not null auto_increment comment '主键id',
21+
`user_id` int not null comment '用户',
22+
`unit_id` int not null comment '业务单元',
23+
`unit_type` varchar(60) not null comment '业务单元类型',
24+
`tenant_id` int not null comment '组织id',
25+
`role_id` int not null comment '角色id',
26+
`expired_time` timestamp comment '过期时间',
27+
`created_by` varchar(60) not null comment '创建人',
28+
`created_time` timestamp not null default current_timestamp comment '创建时间',
29+
`last_updated_by` varchar(60) not null comment '最后修改人',
30+
`last_updated_time` timestamp not null default current_timestamp comment '更新时间',
31+
primary key (`id`) using btree,
32+
unique index `u_idx_auth_users_units_roles` (`user_id`, `unit_id`, `unit_type`) using btree
33+
) engine = innodb comment = '';
34+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (1, 'Tinybuilder_Admin', '超级管理员', '1', '2025-10-29 01:37:10', '1', '2025-10-29 01:37:10');
2+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (2, 'Tinybuilder_Tenant_Admin', '组织管理员', '1', '2025-10-29 01:37:36', '1', '2025-10-29 01:37:36');
3+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (3, 'Tinybuilder_Platform_Admin', '设计器管理员', '1', '2025-10-29 01:38:00', '1', '2025-10-29 01:38:00');
4+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (4, 'Tinybuilder_App_Admin', '应用管理员', '1', '2025-10-29 01:39:06', '1', '2025-10-29 01:39:06');
5+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (5, 'Tinybuilder_App_Developer', '应用开发者', '1', '2025-10-29 01:39:26', '1', '2025-10-29 01:39:26');
6+
INSERT INTO `t_permission_role` (`id`, `name`, `description`, `created_by`, `created_time`, `last_updated_by`, `last_updated_time`) VALUES (6, 'Guest', '游客', '1', '2025-10-29 01:39:38', '1', '2025-10-29 01:39:38');

0 commit comments

Comments
 (0)