Доработайте публикацию и сверку вложений по итогам ревью

This commit is contained in:
2026-11-18 11:43:27 +03:00
parent 1f06d9f4ab
commit 80c4a56200
27 changed files with 605 additions and 275 deletions
+17 -7
View File
@@ -1,9 +1,17 @@
package attachment
import (
"context"
"github.com/google/uuid"
"time"
"github.com/google/uuid"
)
type FileStatus string
const (
FilePending FileStatus = "pending"
FileReady FileStatus = "ready"
FileFailed FileStatus = "failed"
)
type Attachment struct {
@@ -11,12 +19,14 @@ type Attachment struct {
Filename string
FileHash []byte
SizeBytes int64
MIMEType, Status string
MIMEType string
Status FileStatus
CreatedAt time.Time
}
type Repository interface {
IsMember(context.Context, uuid.UUID, uuid.UUID) (bool, error)
Publish(context.Context, Attachment, string) error
GetForMember(context.Context, uuid.UUID, uuid.UUID) (Attachment, error)
type UploadInput struct {
ChatID uuid.UUID
Filename string
MIMEType string
SizeBytes int64
}