23 lines
610 B
Java
23 lines
610 B
Java
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();
|
|
}
|
|
}
|
|
} |