解决角色列表为空时可能存在的SQL错误;将api_set字段长度改为3000
This commit is contained in:
parent
e4b4187bdb
commit
a9aff3009d
|
@ -52,6 +52,9 @@ public class IamRolePermissionServiceImpl extends BaseIamServiceImpl<IamRolePerm
|
|||
|
||||
@Override
|
||||
public List<IamFrontendPermission> getPermissionList(String application, List<Long> roleIds) {
|
||||
if (V.isEmpty(roleIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> permissionIds = getPermissionIdsByRoleIds(application, roleIds);
|
||||
if(V.isEmpty(permissionIds)){
|
||||
return Collections.emptyList();
|
||||
|
@ -66,7 +69,13 @@ public class IamRolePermissionServiceImpl extends BaseIamServiceImpl<IamRolePerm
|
|||
|
||||
@Override
|
||||
public List<String> getApiUrlList(String application, List<Long> roleIds) {
|
||||
if (V.isEmpty(roleIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> permissionIds = getPermissionIdsByRoleIds(application, roleIds);
|
||||
if (V.isEmpty(permissionIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 查询权限
|
||||
List<IamFrontendPermission> frontendPermissions = iamFrontendPermissionService.getEntityList(
|
||||
Wrappers.<IamFrontendPermission>lambdaQuery()
|
||||
|
@ -131,6 +140,9 @@ public class IamRolePermissionServiceImpl extends BaseIamServiceImpl<IamRolePerm
|
|||
* @return
|
||||
*/
|
||||
private List<Long> getPermissionIdsByRoleIds(String application, List<Long> roleIds){
|
||||
if (V.isEmpty(roleIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<IamRolePermission> permissions = getEntityList(Wrappers.<IamRolePermission>lambdaQuery()
|
||||
.select(IamRolePermission::getPermissionId)
|
||||
.in(IamRolePermission::getRoleId, roleIds));
|
||||
|
|
|
@ -70,7 +70,7 @@ create table iam_frontend_permission
|
|||
display_type varchar(20) not null comment '展现类型',
|
||||
display_name varchar(100) not null comment '显示名称',
|
||||
frontend_code varchar(100) not null comment '前端编码',
|
||||
api_set varchar(5000) null comment '接口列表',
|
||||
api_set varchar(3000) null comment '接口列表',
|
||||
sort_id bigint null comment '排序号',
|
||||
is_deleted tinyint(1) default 0 not null comment '是否删除',
|
||||
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
|
|
|
@ -70,7 +70,7 @@ create table iam_frontend_permission
|
|||
display_type varchar(20) not null comment '展现类型',
|
||||
display_name varchar(100) not null comment '显示名称',
|
||||
frontend_code varchar(100) not null comment '前端编码',
|
||||
api_set varchar(5000) null comment '接口列表',
|
||||
api_set varchar(3000) null comment '接口列表',
|
||||
sort_id bigint null comment '排序号',
|
||||
is_deleted tinyint(1) default 0 not null comment '是否删除',
|
||||
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
|
|
|
@ -115,7 +115,7 @@ create table ${SCHEMA}.iam_frontend_permission
|
|||
display_type VARCHAR2(20) not null,
|
||||
display_name VARCHAR2(100) not null,
|
||||
frontend_code VARCHAR2(100) null,
|
||||
api_set VARCHAR2(5000) null,
|
||||
api_set VARCHAR2(3000) null,
|
||||
sort_id NUMBER(20) null,
|
||||
is_deleted NUMBER(1) DEFAULT 0 not null,
|
||||
create_time timestamp default CURRENT_TIMESTAMP not null,
|
||||
|
|
|
@ -111,7 +111,7 @@ create table iam_frontend_permission
|
|||
display_type varchar(20) not null,
|
||||
display_name varchar(100) not null,
|
||||
frontend_code varchar(100) null,
|
||||
api_set varchar(5000) null,
|
||||
api_set varchar(3000) null,
|
||||
sort_id bigint null,
|
||||
is_deleted BOOLEAN default FALSE not null,
|
||||
create_time timestamp default CURRENT_TIMESTAMP not null,
|
||||
|
|
|
@ -115,7 +115,7 @@ create table ${SCHEMA}.iam_frontend_permission
|
|||
display_type varchar(20) not null,
|
||||
display_name varchar(100) not null,
|
||||
frontend_code varchar(100) null,
|
||||
api_set varchar(5000) null,
|
||||
api_set varchar(3000) null,
|
||||
sort_id bigint null,
|
||||
is_deleted tinyint default 0 not null,
|
||||
create_time datetime default CURRENT_TIMESTAMP not null,
|
||||
|
|
Loading…
Reference in New Issue