refactor(权限点): 列表查询增加参数;删除返回bizNo

This commit is contained in:
zhansihu 2023-09-13 10:13:57 +08:00
parent fd1aeee956
commit af0ef14370
5 changed files with 16 additions and 8 deletions

View File

@ -42,9 +42,9 @@ public interface PermissionPointApi {
@PostMapping(value = "/api/v1/permissionPoint/save")
ApiResult<PermissionPointDTO> savePermissionPoint(@RequestBody PermissionPointDTO dto);
/** 删除权限点 - 直接删除 **/
/** 删除权限点 **/
@PostMapping(value = "/api/v1/permissionPoint/delete/{permissionId}")
ApiResult<Void> deletePermissionPoint(@PathVariable Long permissionId);
ApiResult<List<String>> deletePermissionPoint(@PathVariable Long permissionId);
/** 位置移动 **/

View File

@ -18,6 +18,12 @@ public class PermissionPointListQueryRequest {
* **/
private Integer featureType;
/**
* 授权策略类型允许为空 1-平台授权型 2-客户授权型 3-免授权型
* 参考DelegatedType
**/
private Integer delegatedType;
/**
* 权限点所属工作台
* **/

View File

@ -54,9 +54,8 @@ public class PermissionPointController implements PermissionPointApi {
}
@Override
public ApiResult<Void> deletePermissionPoint(Long permissionId) {
permissionPointService.delete(permissionId);
return ApiResult.ok();
public ApiResult<List<String>> deletePermissionPoint(Long permissionId) {
return ApiResult.ok(permissionPointService.delete(permissionId));
}

View File

@ -36,8 +36,8 @@ public interface PermissionPointService {
/** 保存权限点 **/
PermissionPointDTO save(PermissionPointDTO dto);
/** 删除权限点 **/
void delete(Long permissionId);
/** 删除权限点 返回business_no **/
List<String> delete(Long permissionId);
/** 位置移动-父级和排序 **/
void move(PermissionPointMoveRequest request);

View File

@ -303,8 +303,9 @@ public class PermissionPointServiceImpl implements PermissionPointService {
@Transactional(rollbackFor = Throwable.class)
@Override
public void delete(Long permissionPointId) {
public List<String> delete(Long permissionPointId) {
List<Long> delIds = new ArrayList<>();
List<String> bizNoList = new ArrayList<>();
SaasFeature feature = getAndCheck(permissionPointId);
//删除自己
this.saasFeatureDao.removeById(permissionPointId);
@ -317,6 +318,7 @@ public class PermissionPointServiceImpl implements PermissionPointService {
delIds.addAll(childrenIds);
}
this.saasPgroupPermissionRelationDao.removeByPermissionPointIds(delIds);
return bizNoList;
}
@ -334,6 +336,7 @@ public class PermissionPointServiceImpl implements PermissionPointService {
.eq(Objects.nonNull(request.getTerminal()), SaasFeature::getTerminal, request.getTerminal())
.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())
.likeRight(Objects.nonNull(request.getLikePath()), SaasFeature::getPath, request.getLikePath());
return this.saasFeatureDao.list(wrapper)