[#1650] Expose externalRef via REST API (#1655)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-02-19 16:21:18 +02:00
committed by GitHub
parent 1d981802f4
commit bf1c7df52e
5 changed files with 126 additions and 40 deletions

View File

@@ -42,7 +42,8 @@ public final class MgmtActionMapper {
if (actions == null) {
return Collections.emptyList();
}
return new ResponseList<>(actions.stream().map(action -> MgmtActionMapper.toResponse(action, repMode))
return new ResponseList<>(actions.stream()
.map(action -> toResponse(action, repMode))
.collect(Collectors.toList()));
}

View File

@@ -53,6 +53,7 @@ import org.eclipse.hawkbit.rest.data.SortDirection;
import org.eclipse.hawkbit.util.IpUtil;
import org.eclipse.hawkbit.utils.TenantConfigHelper;
import org.springframework.data.domain.PageRequest;
import org.springframework.util.ObjectUtils;
/**
* A mapper which maps repository model to RESTful model representation and
@@ -280,6 +281,11 @@ public final class MgmtTargetMapper {
result.setMaintenanceWindow(maintenanceWindow);
}
final String externalRef = action.getExternalRef();
if (!ObjectUtils.isEmpty(externalRef)) {
result.setExternalRef(externalRef);
}
MgmtRestModelMapper.mapBaseToBase(result, action);
result.add(