diff --git a/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java b/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java index aa91506..2fb6daa 100644 --- a/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java +++ b/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java @@ -28,6 +28,9 @@ public class Telemetry extends DomainObject { @Column(name = "timestamp") private ZonedDateTime timestamp; + @Column(name = "contact") + private String contact; + public String getProfiles() { return profiles; } @@ -75,4 +78,12 @@ public ZonedDateTime getTimestamp() { public void setTimestamp(ZonedDateTime timestamp) { this.timestamp = timestamp; } + + public String getContact() { + return contact; + } + + public void setContact(String contact) { + this.contact = contact; + } } diff --git a/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java b/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java index 5e58f30..f3769c0 100644 --- a/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java +++ b/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java @@ -7,11 +7,11 @@ import java.util.List; @JsonInclude(JsonInclude.Include.NON_EMPTY) -public record TelemetryDTO(Long id, String version, String serverUrl, String universityName, String mainAdminName, List profiles, ZonedDateTime timestamp) { +public record TelemetryDTO(Long id, String version, String serverUrl, String operator, String adminName, List profiles, String contact, ZonedDateTime timestamp) { public static TelemetryDTO from(Telemetry telemetry) { List profilesList = List.of(telemetry.getProfiles().split(",")); - return new TelemetryDTO(telemetry.getId(), telemetry.getVersion(), telemetry.getServerUrl(), telemetry.getUniversityName(), telemetry.getMainAdminName(), profilesList, telemetry.getTimestamp()); + return new TelemetryDTO(telemetry.getId(), telemetry.getVersion(), telemetry.getServerUrl(), telemetry.getUniversityName(), telemetry.getMainAdminName(), profilesList, telemetry.getContact(), telemetry.getTimestamp()); } public static Telemetry to(TelemetryDTO telemetryDTO) { @@ -20,10 +20,11 @@ public static Telemetry to(TelemetryDTO telemetryDTO) { telemetry.setId(telemetryDTO.id()); telemetry.setVersion(telemetryDTO.version()); telemetry.setServerUrl(telemetryDTO.serverUrl()); - telemetry.setUniversityName(telemetryDTO.universityName()); - telemetry.setMainAdminName(telemetryDTO.mainAdminName()); + telemetry.setUniversityName(telemetryDTO.operator()); + telemetry.setMainAdminName(telemetryDTO.adminName()); telemetry.setProfiles(profiles); telemetry.setTimestamp(telemetryDTO.timestamp()); + telemetry.setContact(telemetryDTO.contact()); return telemetry; } }