3
3
import lombok .RequiredArgsConstructor ;
4
4
import org .lowcoder .api .application .ApplicationApiService ;
5
5
import org .lowcoder .api .framework .view .ResponseView ;
6
- import org .lowcoder .api .meta .view .MetaView ;
6
+ import org .lowcoder .api .meta .view .* ;
7
7
import org .lowcoder .domain .application .model .Application ;
8
+ import org .lowcoder .domain .application .service .ApplicationRecordService ;
8
9
import org .lowcoder .domain .application .service .ApplicationServiceImpl ;
9
10
import org .lowcoder .domain .bundle .model .Bundle ;
10
11
import org .lowcoder .domain .bundle .service .BundleServiceImpl ;
20
21
import org .lowcoder .domain .query .service .LibraryQueryServiceImpl ;
21
22
import org .lowcoder .domain .user .model .User ;
22
23
import org .lowcoder .domain .user .service .UserServiceImpl ;
24
+ import org .lowcoder .sdk .util .LocaleUtils ;
23
25
import org .springframework .web .bind .annotation .RequestBody ;
24
26
import org .springframework .web .bind .annotation .RestController ;
25
27
import reactor .core .publisher .Flux ;
@@ -37,17 +39,18 @@ public class MetaController implements MetaEndpoints {
37
39
private final BundleServiceImpl bundleServiceImpl ;
38
40
private final GroupServiceImpl groupServiceImpl ;
39
41
private final LibraryQueryServiceImpl libraryQueryServiceImpl ;
42
+ private final ApplicationRecordService applicationRecordService ;
40
43
41
44
@ Override
42
45
public Mono <ResponseView <MetaView >> getMetaData (@ RequestBody GetMetaDataRequest param ) {
43
- Flux <Application > appsFlux = applicationServiceImpl .findByIdIn (param .appIds ());
44
- Flux <User > usersFlux = userServiceImpl .getByIds (param .userIds ()).flatMapMany (map -> Flux .fromIterable (map .values ()));
45
- Flux <Organization > orgsFlux = organizationServiceImpl .getByIds (param .orgIds ());
46
- Flux <Folder > foldersFlux = folderServiceImpl .findByIds (param .folderIds ());
47
- Flux <Datasource > datasourcesFlux = datasourceServiceImpl .getByIds (param .datasourceIds ());
48
- Flux <Bundle > bundlesFlux = bundleServiceImpl .findByIdIn (param .bundleIds ());
49
- Flux <Group > groupsFlux = groupServiceImpl .getByIds (param .groupIds ());
50
- Flux <LibraryQuery > queriesFlux = libraryQueryServiceImpl .getByIds (param .libraryQueryIds ());
46
+ Flux <ApplicationMetaView > appsFlux = applicationServiceImpl .findByIdIn (param .appIds ()). flatMap ( app -> ApplicationMetaView . of ( app , applicationRecordService ));
47
+ Flux <UserMetaView > usersFlux = userServiceImpl .getByIds (param .userIds ()).flatMapMany (map -> Flux .fromIterable (map .values ())). map ( UserMetaView :: of );
48
+ Flux <OrgMetaView > orgsFlux = organizationServiceImpl .getByIds (param .orgIds ()). map ( OrgMetaView :: of );
49
+ Flux <FolderMetaView > foldersFlux = folderServiceImpl .findByIds (param .folderIds ()). map ( FolderMetaView :: of );
50
+ Flux <DatasourceMetaView > datasourcesFlux = datasourceServiceImpl .getByIds (param .datasourceIds ()). map ( DatasourceMetaView :: of );
51
+ Flux <BundleMetaView > bundlesFlux = bundleServiceImpl .findByIdIn (param .bundleIds ()). map ( BundleMetaView :: of );
52
+ Flux <GroupMetaView > groupsFlux = Flux . deferContextual ( contextView -> groupServiceImpl .getByIds (param .groupIds ()). map ( group -> GroupMetaView . of ( group , LocaleUtils . getLocale ( contextView )) ));
53
+ Flux <LibraryQueryMetaView > queriesFlux = libraryQueryServiceImpl .getByIds (param .libraryQueryIds ()). map ( LibraryQueryMetaView :: of );
51
54
return Mono .zip (
52
55
appsFlux .collectList (),
53
56
usersFlux .collectList (),
0 commit comments