Skip to content
Snippets Groups Projects
Commit 42ea92f1 authored by Alexander Görlitz's avatar Alexander Görlitz
Browse files

Merge remote-tracking branch 'origin/main'

parents c3303d15 578ce8ec
No related merge requests found
Showing
with 214 additions and 11 deletions
import java.time.Instant; import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Objects;
public record PreparationNote( import java.util.Objects;
Id<PreparationNote> preparationNoteId,
String text, public class PreparationNote {
Operation operationId, private String noteId; // Eindeutige Identifikation der Notiz
Instant lastUpdate private String operationId; // ID der zugehörigen Operation
) { private String content; // Inhalt der Notiz
// Konstruktor zur Initialisierung der Notiz-Attribute
public PreparationNote(String noteId, String operationId, String content) {
this.noteId = noteId;
this.operationId = operationId;
this.content = content;
}
// Getter und Setter Methoden für die Attribute
public String getId() {
return noteId;
}
public void setNoteId(String noteId) {
this.noteId = noteId;
}
public String getOperationId() {
return operationId;
}
public void setOperationId(String operationId) {
this.operationId = operationId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
// toString Methode zur Darstellung der Notiz als String
@Override
public String toString() {
return "PreparationNote{" +
"noteId='" + noteId + '\'' +
", operationId='" + operationId + '\'' +
", content='" + content + '\'' +
'}';
}
// equals Methode zum Vergleichen von zwei PreparationNote Objekten
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PreparationNote that = (PreparationNote) o;
return Objects.equals(noteId, that.NoteId) &&
Objects.equals(operationId, that.operationId) &&
Objects.equals(content, that.content);
}
// hashCode Methode zur Berechnung des Hashcodes eines PreparationNote Objekts
@Override
public int hashCode() {
return Objects.hash(noteId, operationId, content);
}
} }
//public record PreparationNote(
// Id<PreparationNote> preparationNoteId,
// String text,
// Operation operationId,
// Instant lastUpdate
//) {
public class PreparationNoteCommand {
private String operationId;
private String content;
// Konstruktor zur Initialisierung der Command-Attribute
public PreparationNoteCommand(String operationId, String content) {
this.operationId = operationId;
this.content = content;
}
// Getter und Setter Methoden für die Attribute
public String getOperationId() {
return operationId;
}
public void setOperationId(String operationId) {
this.operationId = operationId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
import java.util.List;
public interface PreparationNoteService {
PreparationNote createNote(PreparationNoteCommand command); // Methode zum Erstellen einer neuen Notiz
PreparationNote updateNote(String noteId, PreparationNoteCommand command); // Methode zum Aktualisieren einer Notiz
void deleteNote(String noteId); // Methode zum Löschen einer Notiz
PreparationNote getNoteById(String noteId); // Methode zum Abrufen einer Notiz nach ID
List<PreparationNote> getNotesByOperationId(String operationId); // Methode zum Abrufen von Notizen nach Operation-ID
}
import java.time.Instant; import java.time.Instant;
import java.util.Objects;
public record Room( public class Room {
Id<Room> roomId, private String roomId; // Eindeutige Identifikation des Raum
String roomName, private String roomName;// Name des Raums
Instant lastUpdate private int capacity; // Kapazität des Raums
) {
// Konstruktor zur Initialisierung der Raum-Attribute
public Room(String RoomId, String roomName, int capacity) {
this.roomId = roomId;
this.roomName = RoomName;
this.capacity = capacity;
}
// Getter und Setter Methoden für die Attribute
public String getRoomId() {
return RoomId;
}
public void setRoomId(String roomId) {
this.id = RoomId;
}
public String getRoomName() {
return roomName;
}
public void setRoomName(String roomName) {
this.roomName = roomName;
}
public int getCapacity() {
return capacity;
}
public void setCapacity(int capacity) {
this.capacity = capacity;
}
// toString Methode zur Darstellung des Raums als String
@Override
public String toString() {
return "Room{" +
"roomId='" + roomId + '\'' +
", roomName='" + roomName + '\'' +
", capacity=" + capacity +
'}';
}
// equals Methode zum Vergleichen von zwei Room Objekten
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Room room = (Room) o;
return capacity == room.capacity &&
Objects.equals(roomId, room.roomId) &&
Objects.equals(roomName, room.roomName);
}
// hashCode Methode zur Berechnung des Hashcodes eines Room Objekts
@Override
public int hashCode() {
return Objects.hash(roomId, roomName, capacity);
}
} }
//public record Room(
// Id<Room> roomId,
// String roomName,
// Instant lastUpdate
//) {
public class RoomCommand {
private String roomName;
private int capacity;
// Konstruktor zur Initialisierung der Kommando-Attribute
public RoomCommand(String roomName, int capacity) {
this.roomName = roomName;
this.capacity = capacity;
}
// Getter und Setter Methoden für die Attribute
public String getRoomName() {
return roomName;
}
public void setRoomName(String roomName) {
this.roomName = roomName;
}
public int getCapacity() {
return capacity;
}
public void setCapacity(int capacity) {
this.capacity = capacity;
}
}
import java.util.List;
public interface RoomService {
Room createRoom(RoomCommand command); // Methode zum Erstellen eines neuen Raums
Room updateRoom(String roomId, RoomCommand command); // Methode zum Aktualisieren eines Raums
void deleteRoom(String roomId); // Methode zum Löschen eines Raums
Room getRoomById(String roomId); // Methode zum Abrufen eines Raums nach ID
List<Room> getAllRooms(); // Methode zum Abrufen aller Räume
}
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment