Перенос кода из ЛР5 в ЛР6 (начало)

This commit is contained in:
2026-11-24 15:44:25 +03:00
parent 470d9d6f1e
commit a1071c87e9
71 changed files with 3179 additions and 0 deletions
@@ -0,0 +1,23 @@
package ru.mtusi.messenger.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.Size;
import java.util.List;
import java.util.UUID;
public record CreateMessage(
@JsonProperty("text")
@Size(max = 4000, message = "text must be up to 4000 characters")
String text,
@JsonProperty("attachment_ids")
@Size(max = 10, message = "attachment_ids can contain up to 10 items")
List<UUID> attachmentIds
) {
public CreateMessage {
if (attachmentIds == null) {
attachmentIds = List.of();
}
}
}