31 lines
975 B
Go
31 lines
975 B
Go
|
|
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
|
|||
|
|
}
|