forked from mtusi2026/mtusi2026lab5
ЛР 5 — асинхронная обработка и версии pipeline
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Attachment struct {
|
||||
ID string
|
||||
ChatID string
|
||||
OwnerID string
|
||||
Filename string
|
||||
ObjectKey string
|
||||
StagingKey string
|
||||
ErrorCode *string
|
||||
Variants []AttachmentVariant
|
||||
ContentType string
|
||||
SizeBytes int64
|
||||
SHA256 string
|
||||
Status string
|
||||
PipelineVersion int32
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type AttachmentVariant struct {
|
||||
Name string
|
||||
ObjectKey string
|
||||
ContentType string
|
||||
SizeBytes int64
|
||||
Width int
|
||||
Height int
|
||||
SHA256 string
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type AttachmentJob struct {
|
||||
ID string
|
||||
AttachmentID string
|
||||
PipelineVersion int32
|
||||
AttemptsStarted int32
|
||||
MaxAttempts int32
|
||||
LeaseGeneration int32
|
||||
LeaseUntil time.Time
|
||||
}
|
||||
|
||||
type AttachmentJobState struct {
|
||||
AttachmentID string
|
||||
PipelineVersion int32
|
||||
ID string
|
||||
Status string
|
||||
LeaseGeneration int32
|
||||
AttemptsStarted int32
|
||||
MaxAttempts int32
|
||||
LeaseUntil *time.Time
|
||||
LeaseExpired bool
|
||||
NextAttemptAt *time.Time
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Chat struct {
|
||||
ID string
|
||||
Title string
|
||||
MemberIDs []string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Message struct {
|
||||
ID string
|
||||
ChatID string
|
||||
SenderID string
|
||||
Text string
|
||||
AttachmentIDs []string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Session struct {
|
||||
TokenHash []byte
|
||||
UserID string
|
||||
CreatedAt time.Time
|
||||
ExpiresAt time.Time
|
||||
RevokedAt *time.Time
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
ID string
|
||||
Username string
|
||||
DisplayName string
|
||||
PasswordHash string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user