Skip to content

Commit

Permalink
add contact
Browse files Browse the repository at this point in the history
  • Loading branch information
BBesrour committed Aug 18, 2024
1 parent 3fc14b2 commit e15a2bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> profiles, ZonedDateTime timestamp) {
public record TelemetryDTO(Long id, String version, String serverUrl, String operator, String adminName, List<String> profiles, String contact, ZonedDateTime timestamp) {

public static TelemetryDTO from(Telemetry telemetry) {
List<String> 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) {
Expand All @@ -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;
}
}

0 comments on commit e15a2bf

Please sign in to comment.