Hello,
what do you mean by dot form?
Another option could be to use MapStruct and do something like this:
public List<AdminDto> getAdminsByCompanyId(String companyId) {
return adminRepo.findAllByCompanyId(companyId).stream()
.map(AdminMapper::toDto)
.collect(Collectors.toList());
}
if you want to wrap into your object ReporterResponse the resutlat you could also do this:
public ResponseDate getAdminsByCompanyId(String companyId) {
ReporterResponse reporterResponse = new ReporterResponse();
reporterResponse.setData(adminRepo.findAllByCompanyId(companyId).stream()
.map(AdminMapper::toDto)
.collect(Collectors.toList()));
reporterResponse.setStatus(true);
}
Hope it help