forked from mtusi2026/mtusi2026lab6
Перенос кода из ЛР5 в ЛР6 (начало)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user