Доработайте публикацию и сверку вложений по итогам ревью
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user