feat: port lab4 implementation

This commit is contained in:
kk10
2026-11-13 15:52:39 +03:00
parent 276dbdad8a
commit 36d9b0c8f6
101 changed files with 8426 additions and 6 deletions
+34
View File
@@ -0,0 +1,34 @@
package model
import (
"time"
"github.com/google/uuid"
)
type ContentType string
const (
ContentTypePNG ContentType = "image/png"
ContentTypeJPEG ContentType = "image/jpeg"
)
type AttachmentStatus string
const (
AttachmentStatusReady AttachmentStatus = "ready"
)
type Attachment struct {
ID uuid.UUID
ChatID uuid.UUID
OwnerID uuid.UUID
Filename string
ContentType ContentType
SizeBytes int
Sha256 string
Status AttachmentStatus
ErrorCode *string
CreatedAt time.Time
UpdatedAt time.Time
}
+14
View File
@@ -0,0 +1,14 @@
package model
import (
"time"
"github.com/google/uuid"
)
type Chat struct {
ID uuid.UUID
Title string
MemberIDs []uuid.UUID
CreatedAt time.Time
}
+16
View File
@@ -0,0 +1,16 @@
package model
import (
"time"
"github.com/google/uuid"
)
type Message struct {
ID uuid.UUID
ChatID uuid.UUID
SenderID uuid.UUID
Text string
AttachmentIDs []uuid.UUID
CreatedAt time.Time
}
+9
View File
@@ -0,0 +1,9 @@
package model
import "time"
type Session struct {
Token string
ExpiresAt time.Time
User User
}
+14
View File
@@ -0,0 +1,14 @@
package model
import (
"time"
"github.com/google/uuid"
)
type User struct {
ID uuid.UUID
Username string
DisplayName string
CreatedAt time.Time
}