@@ -43,7 +43,7 @@ public Mono<ResponseView<FolderInfoView>> create(@RequestBody Folder folder) {
43
43
@ Override
44
44
public Mono <ResponseView <Void >>delete (@ PathVariable ("id" )String folderId ) {
45
45
return gidService .convertFolderIdToObjectId (folderId ).flatMap (objectId ->
46
- folderApiService .delete (objectId )
46
+ folderApiService .delete (objectId . orElse ( null ) )
47
47
.delayUntil (f ->businessEventPublisher .publishFolderCommonEvent (f .getId (),f .getName (),EventType .FOLDER_DELETE ))
48
48
.then (Mono .fromSupplier (() ->ResponseView .success (null ))));
49
49
}
@@ -73,8 +73,9 @@ public Mono<PageResponseView<?>> getElements(@RequestParam(value = "id", require
73
73
@ RequestParam (required =false )String category ,
74
74
@ RequestParam (required =false ,defaultValue ="1" )Integer pageNum ,
75
75
@ RequestParam (required =false ,defaultValue ="0" )Integer pageSize ) {
76
- return gidService .convertFolderIdToObjectId (folderId ).flatMap (objectId -> {
77
- var flux =folderApiService .getElements (objectId ,applicationType ,name ,category ).cache ();
76
+ return gidService .convertFolderIdToObjectId (folderId ).flatMap (optionalObjectId -> {
77
+ String objectId =optionalObjectId .orElse (null );
78
+ var flux =folderApiService .getElements (optionalObjectId .orElse (null ),applicationType ,name ,category ).cache ();
78
79
var countMono =flux .count ();
79
80
var flux1 =flux .skip ((long ) (pageNum -1 ) *pageSize );
80
81
if (pageSize >0 )flux1 =flux1 .take (pageSize );
@@ -89,8 +90,8 @@ public Mono<PageResponseView<?>> getElements(@RequestParam(value = "id", require
89
90
public Mono <ResponseView <Void >>move (@ PathVariable ("id" )String applicationLikeId ,
90
91
@ RequestParam (value ="targetFolderId" ,required =false )String targetFolderId ) {
91
92
return gidService .convertFolderIdToObjectId (targetFolderId ).flatMap (objectId ->
92
- folderApiService .move (applicationLikeId ,objectId )
93
- .then (businessEventPublisher .publishApplicationCommonEvent (applicationLikeId ,objectId ,APPLICATION_MOVE ))
93
+ folderApiService .move (applicationLikeId ,objectId . orElse ( null ) )
94
+ .then (businessEventPublisher .publishApplicationCommonEvent (applicationLikeId ,objectId . orElse ( null ) ,APPLICATION_MOVE ))
94
95
.then (Mono .fromSupplier (() ->ResponseView .success (null ))));
95
96
}
96
97
@@ -104,7 +105,7 @@ public Mono<ResponseView<Void>> updatePermission(@PathVariable String folderId,
104
105
}
105
106
106
107
return gidService .convertFolderIdToObjectId (folderId ).flatMap (objectId ->
107
- folderApiService .updatePermission (objectId ,permissionId ,role )
108
+ folderApiService .updatePermission (objectId . orElse ( null ) ,permissionId ,role )
108
109
.then (Mono .fromSupplier (() ->ResponseView .success (null ))));
109
110
}
110
111
@@ -113,7 +114,7 @@ public Mono<ResponseView<Void>> removePermission(
113
114
@ PathVariable String folderId ,
114
115
@ PathVariable String permissionId ) {
115
116
return gidService .convertFolderIdToObjectId (folderId ).flatMap (objectId ->
116
- folderApiService .removePermission (objectId ,permissionId )
117
+ folderApiService .removePermission (objectId . orElse ( null ) ,permissionId )
117
118
.then (Mono .fromSupplier (() ->ResponseView .success (null ))));
118
119
}
119
120
@@ -126,14 +127,14 @@ public Mono<ResponseView<Void>> grantPermission(
126
127
return ofError (INVALID_PARAMETER ,"INVALID_PARAMETER" ,request .role ());
127
128
}
128
129
return gidService .convertFolderIdToObjectId (folderId ).flatMap (objectId ->
129
- folderApiService .grantPermission (objectId ,request .userIds (),request .groupIds (),role )
130
+ folderApiService .grantPermission (objectId . orElse ( null ) ,request .userIds (),request .groupIds (),role )
130
131
.then (Mono .fromSupplier (() ->ResponseView .success (null ))));
131
132
}
132
133
133
134
@ Override
134
135
public Mono <ResponseView <ApplicationPermissionView >>getApplicationPermissions (@ PathVariable String folderId ) {
135
136
return gidService .convertFolderIdToObjectId (folderId ).flatMap (objectId ->
136
- folderApiService .getPermissions (objectId )
137
+ folderApiService .getPermissions (objectId . orElse ( null ) )
137
138
.map (ResponseView ::success ));
138
139
}
139
140
}