proj/Backend/src/main/java/de/itsolutions/ticketsystem/dto/Dtos.java
2026-01-22 11:49:48 +01:00

217 lines
6.4 KiB
Java

package de.itsolutions.ticketsystem.dto;
import java.util.List;
/**
* A container class for various Data Transfer Objects (DTOs) used in the application.
*/
public class Dtos {
/**
* DTO for user registration requests.
*/
public static class RegisterRequest {
private String firstname;
private String lastname;
private String email;
private String password;
private String role;
private List<Long> roomIds;
/**
* Gets the first name of the user.
* @return The first name.
*/
public String getFirstname() { return firstname; }
/**
* Sets the first name of the user.
* @param firstname The first name.
*/
public void setFirstname(String firstname) { this.firstname = firstname; }
/**
* Gets the last name of the user.
* @return The last name.
*/
public String getLastname() { return lastname; }
/**
* Sets the last name of the user.
* @param lastname The last name.
*/
public void setLastname(String lastname) { this.lastname = lastname; }
/**
* Gets the email of the user.
* @return The email.
*/
public String getEmail() { return email; }
/**
* Sets the email of the user.
* @param email The email.
*/
public void setEmail(String email) { this.email = email; }
/**
* Gets the password of the user.
* @return The password.
*/
public String getPassword() { return password; }
/**
* Sets the password of the user.
* @param password The password.
*/
public void setPassword(String password) { this.password = password; }
/**
* Gets the role of the user.
* @return The role.
*/
public String getRole() { return role; }
/**
* Sets the role of the user.
* @param role The role.
*/
public void setRole(String role) { this.role = role; }
/**
* Gets the list of room IDs the user supervises.
* @return The list of room IDs.
*/
public List<Long> getRoomIds() { return roomIds; }
/**
* Sets the list of room IDs the user supervises.
* @param roomIds The list of room IDs.
*/
public void setRoomIds(List<Long> roomIds) { this.roomIds = roomIds; }
}
/**
* DTO for user login requests.
*/
public static class LoginRequest {
private String email;
private String password;
/**
* Gets the email for login.
* @return The email.
*/
public String getEmail() { return email; }
/**
* Sets the email for login.
* @param email The email.
*/
public void setEmail(String email) { this.email = email; }
/**
* Gets the password for login.
* @return The password.
*/
public String getPassword() { return password; }
/**
* Sets the password for login.
* @param password The password.
*/
public void setPassword(String password) { this.password = password; }
}
/**
* DTO for updating supervised rooms.
*/
public static class UpdateRoomsRequest {
private List<Long> roomIds;
/**
* Gets the list of room IDs.
* @return The list of room IDs.
*/
public List<Long> getRoomIds() { return roomIds; }
/**
* Sets the list of room IDs.
* @param roomIds The list of room IDs.
*/
public void setRoomIds(List<Long> roomIds) { this.roomIds = roomIds; }
}
/**
* DTO for creating a new ticket.
*/
public static class TicketRequest {
private Long roomId;
private String title;
private String description;
/**
* Gets the room ID for the ticket.
* @return The room ID.
*/
public Long getRoomId() { return roomId; }
/**
* Sets the room ID for the ticket.
* @param roomId The room ID.
*/
public void setRoomId(Long roomId) { this.roomId = roomId; }
/**
* Gets the title of the ticket.
* @return The title.
*/
public String getTitle() { return title; }
/**
* Sets the title of the ticket.
* @param title The title.
*/
public void setTitle(String title) { this.title = title; }
/**
* Gets the description of the ticket.
* @return The description.
*/
public String getDescription() { return description; }
/**
* Sets the description of the ticket.
* @param description The description.
*/
public void setDescription(String description) { this.description = description; }
}
/**
* DTO for updating a ticket's status.
*/
public static class TicketStatusRequest {
private String status;
/**
* Gets the new status for the ticket.
* @return The status.
*/
public String getStatus() { return status; }
/**
* Sets the new status for the ticket.
* @param status The status.
*/
public void setStatus(String status) { this.status = status; }
}
/**
* DTO for updating a user's theme preference.
*/
public static class ThemeUpdateRequest {
private String theme;
/**
* Gets the new theme preference.
* @return The theme.
*/
public String getTheme() { return theme; }
/**
* Sets the new theme preference.
* @param theme The theme.
*/
public void setTheme(String theme) { this.theme = theme; }
}
/**
* DTO for changing the user's password.
*/
public static class ChangePasswordRequest {
private String currentPassword;
private String newPassword;
public String getCurrentPassword() { return currentPassword; }
public void setCurrentPassword(String currentPassword) { this.currentPassword = currentPassword; }
public String getNewPassword() { return newPassword; }
public void setNewPassword(String newPassword) { this.newPassword = newPassword; }
}
}