应用下线功能优化

This commit is contained in:
PengShuaixin
2021-04-14 12:29:59 +08:00
parent eb1f8be11e
commit f41e29ab3a

View File

@@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author zhongyuankai * @author zhongyuankai
@@ -94,7 +95,11 @@ public class DeleteAppOrder extends AbstractAppOrder {
} }
// 判断app是否对topic有权限 // 判断app是否对topic有权限
List<AuthorityDO> authorityList = authorityService.getAuthority(orderAppExtension.getAppId()); List<AuthorityDO> authorityList = authorityService.getAuthority(orderAppExtension.getAppId());
if (!ValidateUtils.isEmptyList(authorityList)) { // 过滤权限列表中access=0的
List<AuthorityDO> newAuthorityList = authorityList.stream()
.filter(authorityDO -> authorityDO.getAccess() != 0)
.collect(Collectors.toList());
if (!ValidateUtils.isEmptyList(newAuthorityList)) {
return ResultStatus.OPERATION_FORBIDDEN; return ResultStatus.OPERATION_FORBIDDEN;
} }
if (appService.deleteApp(appDO, userName) > 0) { if (appService.deleteApp(appDO, userName) > 0) {