Lab2- оценка 5
Application (lab2) / app (pull_request) Failing after 36s
Skeleton contracts / contracts (pull_request) Failing after 29s

This commit is contained in:
2026-10-08 14:14:20 +03:00
parent 65003b6119
commit 41e8d67a1a
45 changed files with 3467 additions and 18 deletions
+51
View File
@@ -0,0 +1,51 @@
package model
import "time"
type Time struct {
time.Time
}
func NewTime(t time.Time) Time { return Time{Time: t} }
func (t Time) MarshalJSON() ([]byte, error) {
return []byte(`"` + t.UTC().Format("2006-01-02T15:04:05.000Z") + `"`), nil
}
type User struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt Time `json:"created_at"`
}
type Chat struct {
ID string `json:"id"`
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
CreatedAt Time `json:"created_at"`
}
type Message struct {
ID string `json:"id"`
ChatID string `json:"chat_id"`
SenderID string `json:"sender_id"`
Text string `json:"text"`
CreatedAt Time `json:"created_at"`
}
type Page[T any] struct {
Items []T `json:"items"`
NextCursor *string `json:"next_cursor"`
}
type Health struct {
Status string `json:"status"`
}
type Session struct {
Token string `json:"token"`
TokenType string `json:"token_type"`
ExpiresAt Time `json:"expires_at"`
User User `json:"user"`
}