Initial commit: Эфир мессенджер

This commit is contained in:
2026-04-06 14:57:36 +03:00
commit ff93679b6d
50 changed files with 5642 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
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
}