Files
efir-api-server/internal/models/attachment.go

31 lines
975 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package models
import (
"time"
)
type Attachment struct {
ID int64 `json:"id"`
MessageID *int64 `json:"message_id,omitempty"`
FileName string `json:"file_name"`
FileSize int64 `json:"file_size"`
StoragePath string `json:"-"` // never send to client
MimeType string `json:"mime_type"`
UploadedAt time.Time `json:"uploaded_at"`
}
// AttachmentResponse используется для отправки информации о файле клиенту
type AttachmentResponse struct {
ID int64 `json:"id"`
FileName string `json:"file_name"`
FileSize int64 `json:"file_size"`
MimeType string `json:"mime_type"`
UploadURL string `json:"upload_url"` // URL для скачивания
UploadedAt time.Time `json:"uploaded_at"`
}
// UploadFileRequest DTO для загрузки файла
type UploadFileRequest struct {
ChatID int64 `json:"chat_id"`
// файл будет в multipart form
}