returned lab1

This commit is contained in:
Khakimov Dmitrij
2026-10-06 19:51:28 +03:00
parent 65003b6119
commit 47a3cd582d
44 changed files with 1863 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
package dto
import "time"
type CreateChatRequest struct {
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
}
type CreateChatResponse struct {
ID string `json:"id"`
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
CreatedAt time.Time `json:"created_at"`
}
+16
View File
@@ -0,0 +1,16 @@
package dto
import "time"
type CreateMessageRequest struct {
ChatID string `json:"-"`
Text string `json:"text"`
}
type CreateMessageResponse struct {
ID string `json:"id"`
ChatID string `json:"chat_id"`
SenderID string `json:"sender_id"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
}
+15
View File
@@ -0,0 +1,15 @@
package dto
import "time"
type CreateUserRequest struct {
Username string `json:"username"`
DisplayName string `json:"display_name"`
}
type CreateUserResponse struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt time.Time `json:"created_at"`
}
+12
View File
@@ -0,0 +1,12 @@
package dto
import "time"
type CurrentUserRequest struct{}
type CurrentUserResponse struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt time.Time `json:"created_at"`
}
+11
View File
@@ -0,0 +1,11 @@
package dto
type ErrorResponse struct {
Error ErrorDetails `json:"error"`
}
type ErrorDetails struct {
Code string `json:"code"`
Message string `json:"message"`
RequestID string `json:"request_id"`
}
+14
View File
@@ -0,0 +1,14 @@
package dto
import "time"
type GetChatRequest struct {
ChatID string `json:"-"`
}
type GetChatResponse struct {
ID string `json:"id"`
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
CreatedAt time.Time `json:"created_at"`
}
+20
View File
@@ -0,0 +1,20 @@
package dto
import "time"
type ListChatsRequest struct {
Limit int `json:"-"`
Cursor string `json:"-"`
}
type ListChatsResponse struct {
Items []ListChatsItem `json:"items"`
NextCursor *string `json:"next_cursor"`
}
type ListChatsItem struct {
ID string `json:"id"`
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
CreatedAt time.Time `json:"created_at"`
}
+22
View File
@@ -0,0 +1,22 @@
package dto
import "time"
type ListMessagesRequest struct {
ChatID string `json:"-"`
Limit int `json:"-"`
Cursor string `json:"-"`
}
type ListMessagesResponse struct {
Items []ListMessagesItem `json:"items"`
NextCursor *string `json:"next_cursor"`
}
type ListMessagesItem struct {
ID string `json:"id"`
ChatID string `json:"chat_id"`
SenderID string `json:"sender_id"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
}
+7
View File
@@ -0,0 +1,7 @@
package dto
type LivenessRequest struct{}
type LivenessResponse struct {
Status string `json:"status"`
}
+7
View File
@@ -0,0 +1,7 @@
package dto
type ReadinessRequest struct{}
type ReadinessResponse struct {
Status string `json:"status"`
}