refactor(权限点): 列表查询增加IDS条件;
fix(权限点): 修正排序bug
This commit is contained in:
parent
76392a072b
commit
42ae74b0e2
@ -2,6 +2,8 @@ package cn.axzo.tyr.client.model.permission;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限点列表查询对象
|
||||
* 按需扩展
|
||||
@ -38,5 +40,8 @@ public class PermissionPointListQueryRequest {
|
||||
* path左匹配
|
||||
* **/
|
||||
private String likePath;
|
||||
|
||||
/** 权限点ID列表 **/
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
||||
|
||||
@ -358,6 +358,7 @@ public class PermissionPointServiceImpl implements PermissionPointService {
|
||||
.eq(Objects.nonNull(request.getFeatureType()), SaasFeature::getFeatureType, request.getFeatureType())
|
||||
.eq(Objects.nonNull(request.getParentId()), SaasFeature::getParentId, request.getParentId())
|
||||
.eq(Objects.nonNull(request.getDelegatedType()), SaasFeature::getDelegatedType, request.getDelegatedType())
|
||||
.in(CollectionUtil.isNotEmpty(request.getIds()), SaasFeature::getId, request.getIds())
|
||||
.likeRight(Objects.nonNull(request.getLikePath()), SaasFeature::getPath, request.getLikePath());
|
||||
|
||||
return this.saasFeatureDao.list(wrapper)
|
||||
@ -391,7 +392,7 @@ public class PermissionPointServiceImpl implements PermissionPointService {
|
||||
//找到需要更新排序的节点
|
||||
for (int i = 0; i < sortedList.size(); i++) {
|
||||
SaasFeature saasFeature = sortedList.get(i);
|
||||
if (Objects.equals(saasFeature.getSort(), i + 1)) {
|
||||
if (!Objects.equals(saasFeature.getSort(), i + 1)) {
|
||||
sortMap.put(saasFeature.getId(), i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,6 +126,7 @@ public class PermissionPointTest {
|
||||
public void testQueryList() {
|
||||
PermissionPointListQueryRequest request = new PermissionPointListQueryRequest();
|
||||
request.setFeatureType(FeatureType.BUTTON.getCode());
|
||||
request.setIds(Arrays.asList(255L, 266L));
|
||||
ApiResult<List<PermissionPointTreeNode>> result = controller.queryList(request);
|
||||
System.out.println(JSON.toJSONString(result));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user