use of org.hisp.dhis.webapi.webdomain.PeriodTypeDTO in project dhis2-core by dhis2.
the class PeriodTypeController method getPeriodTypes.
@GetMapping
public RootNode getPeriodTypes() {
List<String> fields = Lists.newArrayList(contextService.getParameterValues("fields"));
List<PeriodTypeDTO> periodTypes = periodService.getAllPeriodTypes().stream().map(PeriodTypeDTO::new).collect(Collectors.toList());
if (fields.isEmpty()) {
fields.addAll(Preset.ALL.getFields());
}
RootNode rootNode = NodeUtils.createMetadata();
rootNode.addChild(fieldFilterService.filter(PeriodTypeDTO.class, periodTypes, fields));
return rootNode;
}
Aggregations