Content-Length: 367721 | pFad | http://github.com/lowcoder-org/lowcoder/commit/df479c6f67ec2a6233164f47f81037bea4ad5afe

30 Added get api for libraryquery object for import/export feature in EE · lowcoder-org/lowcoder@df479c6 · GitHub
Skip to content

Commit df479c6

Browse files
dragonpooludomikula
authored andcommitted
Added get api for libraryquery object for import/export feature in EE
1 parent 255d870 commit df479c6

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/query/LibraryQueryApiService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
public interface LibraryQueryApiService {
1212
Mono<List<LibraryQueryView>> listLibraryQueries(String name);
1313

14+
Mono<LibraryQueryView> get(String libraryQueryId);
15+
1416
Mono<LibraryQueryView> create(LibraryQuery libraryQuery);
1517

1618
Mono<Boolean> update(String libraryQueryId, UpsertLibraryQueryRequest upsertLibraryQueryRequest);

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/query/LibraryQueryApiServiceImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ private Flux<LibraryQuery> getByOrgIdWithDatasourcePermissions(String orgId) {
113113
set -> set.contains(libraryQuery.getQuery().getDatasourceId())));
114114
}
115115

116+
@Override
117+
public Mono<LibraryQueryView> get(String libraryQueryId) {
118+
return libraryQueryService.getById(libraryQueryId)
119+
.zipWhen(lb -> userService.findById(lb.getCreatedBy()))
120+
.map(tuple -> LibraryQueryView.from(tuple.getT1(), tuple.getT2()));
121+
}
122+
116123
@Override
117124
public Mono<LibraryQueryView> create(LibraryQuery libraryQuery) {
118125
return checkLibraryQueryManagementPermission(libraryQuery)

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/query/LibraryQueryController.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public Mono<PageResponseView<?>> list(@RequestParam(required = false, defaultVal
5353
return fluxToPageResponseView(pageNum, pageSize, flux);
5454
}
5555

56+
@Override
57+
public Mono<ResponseView<LibraryQueryView>> get(@PathVariable String libraryQueryId) {
58+
return libraryQueryApiService.get(libraryQueryId)
59+
.map(ResponseView::success);
60+
}
61+
5662
@Override
5763
public Mono<ResponseView<LibraryQueryView>> create(@RequestBody LibraryQuery libraryQuery) {
5864
return libraryQueryApiService.create(libraryQuery)

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/query/LibraryQueryEndpoints.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ public Mono<PageResponseView<?>> list(@RequestParam(required = false, defaultVal
4343
@RequestParam(required = false, defaultValue = "1") int pageNum,
4444
@RequestParam(required = false, defaultValue = "100") int pageSize);
4545

46+
@Operation(
47+
tags = TAG_LIBRARY_QUERY_MANAGEMENT,
48+
operationId = "getLibraryQuery",
49+
summary = "Get a Library By Id",
50+
description = "Get a Library Query by Id."
51+
)
52+
@GetMapping("/{libraryQueryId}")
53+
public Mono<ResponseView<LibraryQueryView>> get(@PathVariable String libraryQueryId);
54+
4655
@Operation(
4756
tags = TAG_LIBRARY_QUERY_MANAGEMENT,
4857
operationId = "createLibraryQuery",

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/lowcoder-org/lowcoder/commit/df479c6f67ec2a6233164f47f81037bea4ad5afe

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy