Skip to content

Commit

Permalink
Added teamId to service dto
Browse files Browse the repository at this point in the history
  • Loading branch information
larsLotNav committed Sep 20, 2023
1 parent 2d48ebf commit 07415db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,24 @@ public static ServiceDto toServiceDtoShallow(ServiceEntity entity){
dto.setName(entity.getName());
dto.setType(ServiceTypeDto.fromValue(entity.getType().getDbRepresentation()));
dto.setTeam(mapTeamNavnTeamKatalog(entity.getTeam()));
dto.setTeamId(getTeamUidIfPresent(entity.getTeam()));
dto.setPollingUrl(entity.getPolling_url());
dto.setMonitorlink(entity.getMonitorlink());
dto.setStatusNotFromTeam(entity.getStatusNotFromTeam());
return dto;
}

private static UUID getTeamUidIfPresent(String teamId){
UUID uuid = null;
try{
uuid = UUID.fromString(teamId);
}
catch (Exception ignored){

}
return uuid;

}
private static String mapTeamNavnTeamKatalog(String teamId){
UUID uuid;
try{
Expand Down Expand Up @@ -151,6 +163,7 @@ public static ServiceDto toServiceDtoDeep(Map.Entry<ServiceEntity,List<ServiceEn
dto.setName(service.getName());
dto.setType(ServiceTypeDto.fromValue(service.getType().getDbRepresentation()));
dto.setTeam(mapTeamNavnTeamKatalog(service.getTeam()));
dto.setTeamId(getTeamUidIfPresent(service.getTeam()));
dto.setMonitorlink(service.getMonitorlink());
dto.pollingUrl(service.getPolling_url());
dto.setStatusNotFromTeam(service.getStatusNotFromTeam());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,10 @@ components:
$ref: '#/components/schemas/ServiceType'
team:
type: string
teamId:
type: string
format: uuid
readOnly: true
serviceDependencies:
type: array
example: "[Liste av service objekter]"
Expand Down

0 comments on commit 07415db

Please sign in to comment.