Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search params to optional #1246

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading