Merge branch 'hotfix/20240807' into 'master'

Hotfix/20240807

See merge request universal/infrastructure/backend/tyr!116
This commit is contained in:
李龙 2024-08-09 10:22:44 +00:00
commit b3341bfa38
4 changed files with 15 additions and 1 deletions

View File

@ -44,6 +44,12 @@ public class ListPermissionFromRoleGroupReq {
/** 角色组ID **/ /** 角色组ID **/
private List<Long> roleGroupIds; private List<Long> roleGroupIds;
/**
* 原接口使用方有的需要2有的需要3当时加这个出了问题默认为3
* 1-仅查当前code 2-对应code角色组及子级角色组 3-仅对应code角色组的子级
*/
private Integer categoryType;
@Data @Data
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor

View File

@ -57,6 +57,11 @@ public class ListPermissionFromRoleGroupResp {
*/ */
private String roleName; private String roleName;
/**
* 角色编码
*/
private String roleCode;
/** /**
* 权限集ID * 权限集ID
*/ */

View File

@ -1047,7 +1047,9 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
@Override @Override
public List<ListPermissionFromRoleGroupResp> listAuthByResourceAndRoleGroup(ListPermissionFromRoleGroupReq listPermissionFromRoleGroupReq) { public List<ListPermissionFromRoleGroupResp> listAuthByResourceAndRoleGroup(ListPermissionFromRoleGroupReq listPermissionFromRoleGroupReq) {
//确定角色group_id: code对应角色组及其下级 //确定角色group_id: code对应角色组及其下级
List<SaasRoleGroup> groups = roleGroupService.listByCodes(Collections.singletonList(listPermissionFromRoleGroupReq.getCategoryCode()), 3); Integer categoryType = Optional.ofNullable(listPermissionFromRoleGroupReq.getCategoryType())
.orElse(3);
List<SaasRoleGroup> groups = roleGroupService.listByCodes(Collections.singletonList(listPermissionFromRoleGroupReq.getCategoryCode()), categoryType);
if (CollectionUtil.isEmpty(groups)) { if (CollectionUtil.isEmpty(groups)) {
log.warn("no role group found for code :{}", listPermissionFromRoleGroupReq.getCategoryCode()); log.warn("no role group found for code :{}", listPermissionFromRoleGroupReq.getCategoryCode());
return Collections.emptyList(); return Collections.emptyList();

View File

@ -118,6 +118,7 @@
t1.code roleGroupCode, t1.code roleGroupCode,
t3.id roleId, t3.id roleId,
t3.name roleName, t3.name roleName,
t3.role_code roleCode,
t4.group_id permissionGroupId t4.group_id permissionGroupId
FROM FROM