Skip to content

Commit

Permalink
Fix required issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonpoo committed Oct 18, 2024
1 parent 60609a1 commit 260b131
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public Mono<ResponseView<DatasourceStructure>> getStructure(@PathVariable String
* name, type... and the plugin definition of it, excluding the detail configs such as the connection uri, password...
*/
@Override
public Mono<ResponseView<List<Datasource>>> listJsDatasourcePlugins(@RequestParam("appId") String applicationId, @RequestParam String name, @RequestParam String type) {
public Mono<ResponseView<List<Datasource>>> listJsDatasourcePlugins(@RequestParam("appId") String applicationId, @RequestParam(required = false) String name, @RequestParam(required = false) String type) {
String objectId = gidService.convertApplicationIdToObjectId(applicationId);
return datasourceApiService.listJsDatasourcePlugins(objectId, name, type)
.collectList()
Expand All @@ -139,7 +139,7 @@ public Mono<ResponseView<List<Object>>> getPluginDynamicConfig(

@SneakyThrows
@Override
public Mono<ResponseView<List<DatasourceView>>> listOrgDataSources(@RequestParam(name = "orgId") String orgId, @RequestParam String name, @RequestParam String type) {
public Mono<ResponseView<List<DatasourceView>>> listOrgDataSources(@RequestParam(name = "orgId") String orgId, @RequestParam(required = false) String name, @RequestParam(required = false) String type) {
if (StringUtils.isBlank(orgId)) {
return ofError(BizError.INVALID_PARAMETER, "ORG_ID_EMPTY");
}
Expand All @@ -150,7 +150,7 @@ public Mono<ResponseView<List<DatasourceView>>> listOrgDataSources(@RequestParam
}

@Override
public Mono<ResponseView<List<DatasourceView>>> listAppDataSources(@RequestParam(name = "appId") String applicationId, @RequestParam String name, @RequestParam String type) {
public Mono<ResponseView<List<DatasourceView>>> listAppDataSources(@RequestParam(name = "appId") String applicationId, @RequestParam(required = false) String name, @RequestParam(required = false) String type) {
if (StringUtils.isBlank(applicationId)) {
return ofError(BizError.INVALID_PARAMETER, "INVALID_APP_ID");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Mono<ResponseView<DatasourceStructure>> getStructure(@PathVariable String
description = "Retrieve a list of node service plugins available within Lowcoder."
)
@GetMapping("/jsDatasourcePlugins")
public Mono<ResponseView<List<Datasource>>> listJsDatasourcePlugins(@RequestParam("appId") String applicationId, @RequestParam String name, @RequestParam String type);
public Mono<ResponseView<List<Datasource>>> listJsDatasourcePlugins(@RequestParam("appId") String applicationId, @RequestParam(required = false) String name, @RequestParam(required = false) String type);

/**
* Proxy the request to the node service, besides, add the "extra" information from the data source config stored in the mongodb if exists to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public class LibraryQueryController implements LibraryQueryEndpoints
private GidService gidService;

@Override
public Mono<ResponseView<List<LibraryQueryAggregateView>>> dropDownList(@RequestParam String name) {
public Mono<ResponseView<List<LibraryQueryAggregateView>>> dropDownList(@RequestParam(required = false) String name) {
return libraryQueryApiService.dropDownList(name)
.map(ResponseView::success);
}

@Override
public Mono<ResponseView<List<LibraryQueryView>>> list(@RequestParam String name) {
public Mono<ResponseView<List<LibraryQueryView>>> list(@RequestParam(required = false) String name) {
return libraryQueryApiService.listLibraryQueries(name)
.map(ResponseView::success);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface LibraryQueryEndpoints
description = "Retrieve Library Queries in a dropdown format within Lowcoder, suitable for selection in user interfaces."
)
@GetMapping("/dropDownList")
public Mono<ResponseView<List<LibraryQueryAggregateView>>> dropDownList(@RequestParam String name);
public Mono<ResponseView<List<LibraryQueryAggregateView>>> dropDownList(@RequestParam(required = false) String name);

@Operation(
tags = TAG_LIBRARY_QUERY_MANAGEMENT,
Expand All @@ -38,7 +38,7 @@ public interface LibraryQueryEndpoints
description = "Retrieve a list of Library Queries for a specific Organization within Lowcoder."
)
@GetMapping("/listByOrg")
public Mono<ResponseView<List<LibraryQueryView>>> list(@RequestParam String name);
public Mono<ResponseView<List<LibraryQueryView>>> list(@RequestParam(required = false) String name);

@Operation(
tags = TAG_LIBRARY_QUERY_MANAGEMENT,
Expand Down

0 comments on commit 260b131

Please sign in to comment.