From 5a706e56aecebbdc274c10159c6ef2e914b3de1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 11 Nov 2024 16:11:37 +0100 Subject: [PATCH] RLH-19 - Implement UserDto --- .../beatrice/releasehive/dtos/UserDto.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/main/java/wtf/beatrice/releasehive/dtos/UserDto.java diff --git a/src/main/java/wtf/beatrice/releasehive/dtos/UserDto.java b/src/main/java/wtf/beatrice/releasehive/dtos/UserDto.java new file mode 100644 index 0000000..5d3c039 --- /dev/null +++ b/src/main/java/wtf/beatrice/releasehive/dtos/UserDto.java @@ -0,0 +1,68 @@ +package wtf.beatrice.releasehive.dtos; + +import wtf.beatrice.releasehive.models.User; + +import java.util.Date; +import java.util.UUID; + +public class UserDto +{ + + private UUID uuid; + + private String username; + + private String email; + + private Date createdAt; + + private Date updatedAt; + + public UserDto(User user) { + this.uuid = user.getUuid(); + this.username = user.getUsername(); + this.email = user.getEmail(); + this.createdAt = user.getCreatedAt(); + this.updatedAt = user.getUpdatedAt(); +} + + public UUID getUuid() { + return uuid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +}