Files
mtusi2026lab5/src/main/java/ru/mtusi/messenger/dto/Attachment.java
T

31 lines
1.2 KiB
Java

package ru.mtusi.messenger.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.UUID;
public record Attachment(
@JsonProperty("id") UUID id,
@JsonProperty("chat_id") UUID chatId,
@JsonProperty("owner_id") UUID ownerId,
@JsonProperty("filename") String filename,
@JsonProperty("content_type") String contentType,
@JsonProperty("size_bytes") long sizeBytes,
@JsonProperty("sha256") String sha256,
@JsonProperty("status") String status,
@JsonProperty("variants") List<Variant> variants, // <-- Изменили тип
@JsonProperty("error_code") String errorCode,
@JsonProperty("created_at") OffsetDateTime createdAt,
@JsonProperty("updated_at") OffsetDateTime updatedAt
) {
public record Variant(
@JsonProperty("name") String name,
@JsonProperty("content_type") String contentType,
@JsonProperty("size_bytes") long sizeBytes,
@JsonProperty("sha256") String sha256,
@JsonProperty("width") int width,
@JsonProperty("height") int height
) {}
}