Implement lab2 messenger API with PostgreSQL Redis and Docker

This commit is contained in:
Fedoroff
2026-10-13 21:12:44 +03:00
parent 65003b6119
commit c251f2cb7d
34 changed files with 2783 additions and 20 deletions
+14
View File
@@ -0,0 +1,14 @@
package model
import (
"time"
"github.com/google/uuid"
)
type Chat struct {
ID uuid.UUID `json:"id"`
Title string `json:"title"`
MemberIDs []uuid.UUID `json:"member_ids"`
CreatedAt time.Time `json:"created_at"`
}
+15
View File
@@ -0,0 +1,15 @@
package model
import (
"time"
"github.com/google/uuid"
)
type Message struct {
ID uuid.UUID `json:"id"`
ChatID uuid.UUID `json:"chat_id"`
SenderID uuid.UUID `json:"sender_id"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
}
+13
View File
@@ -0,0 +1,13 @@
package model
import (
"github.com/google/uuid"
"time"
)
type User struct {
ID uuid.UUID `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt time.Time `json:"created_at"`
}