forked from mtusi2026/mtusi2026lab2
Начало реализации сервиса.
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
// Package contracts provides primitives to interact with the openapi HTTP API.
|
||||
//
|
||||
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
|
||||
package contracts
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
openapi_types "github.com/oapi-codegen/runtime/types"
|
||||
)
|
||||
|
||||
const (
|
||||
DevUserScopes = "devUser.Scopes"
|
||||
)
|
||||
|
||||
// Defines values for ErrorErrorCode.
|
||||
const (
|
||||
Conflict ErrorErrorCode = "conflict"
|
||||
InternalError ErrorErrorCode = "internal_error"
|
||||
InvalidRequest ErrorErrorCode = "invalid_request"
|
||||
NotFound ErrorErrorCode = "not_found"
|
||||
PayloadTooLarge ErrorErrorCode = "payload_too_large"
|
||||
RateLimited ErrorErrorCode = "rate_limited"
|
||||
Unauthorized ErrorErrorCode = "unauthorized"
|
||||
Unavailable ErrorErrorCode = "unavailable"
|
||||
UnsupportedMediaType ErrorErrorCode = "unsupported_media_type"
|
||||
)
|
||||
|
||||
// Defines values for HealthStatus.
|
||||
const (
|
||||
Ok HealthStatus = "ok"
|
||||
)
|
||||
|
||||
// Chat defines model for Chat.
|
||||
type Chat struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Id openapi_types.UUID `json:"id"`
|
||||
MemberIds []openapi_types.UUID `json:"member_ids"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// ChatPage defines model for ChatPage.
|
||||
type ChatPage struct {
|
||||
Items []Chat `json:"items"`
|
||||
NextCursor *string `json:"next_cursor"`
|
||||
}
|
||||
|
||||
// CreateChat defines model for CreateChat.
|
||||
type CreateChat struct {
|
||||
MemberIds []openapi_types.UUID `json:"member_ids"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// CreateMessage defines model for CreateMessage.
|
||||
type CreateMessage struct {
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
// CreateUser defines model for CreateUser.
|
||||
type CreateUser struct {
|
||||
DisplayName string `json:"display_name"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
// Error defines model for Error.
|
||||
type Error struct {
|
||||
Error struct {
|
||||
Code ErrorErrorCode `json:"code"`
|
||||
Message string `json:"message"`
|
||||
RequestId string `json:"request_id"`
|
||||
} `json:"error"`
|
||||
}
|
||||
|
||||
// ErrorErrorCode defines model for Error.Error.Code.
|
||||
type ErrorErrorCode string
|
||||
|
||||
// Health defines model for Health.
|
||||
type Health struct {
|
||||
Status HealthStatus `json:"status"`
|
||||
}
|
||||
|
||||
// HealthStatus defines model for Health.Status.
|
||||
type HealthStatus string
|
||||
|
||||
// Message defines model for Message.
|
||||
type Message struct {
|
||||
ChatId openapi_types.UUID `json:"chat_id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Id openapi_types.UUID `json:"id"`
|
||||
SenderId openapi_types.UUID `json:"sender_id"`
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
// MessagePage defines model for MessagePage.
|
||||
type MessagePage struct {
|
||||
Items []Message `json:"items"`
|
||||
NextCursor *string `json:"next_cursor"`
|
||||
}
|
||||
|
||||
// User defines model for User.
|
||||
type User struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Id openapi_types.UUID `json:"id"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
// ListChatsParams defines parameters for ListChats.
|
||||
type ListChatsParams struct {
|
||||
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
|
||||
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
|
||||
}
|
||||
|
||||
// ListMessagesParams defines parameters for ListMessages.
|
||||
type ListMessagesParams struct {
|
||||
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
|
||||
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
|
||||
}
|
||||
|
||||
// CreateChatJSONRequestBody defines body for CreateChat for application/json ContentType.
|
||||
type CreateChatJSONRequestBody = CreateChat
|
||||
|
||||
// CreateMessageJSONRequestBody defines body for CreateMessage for application/json ContentType.
|
||||
type CreateMessageJSONRequestBody = CreateMessage
|
||||
|
||||
// RegisterUserJSONRequestBody defines body for RegisterUser for application/json ContentType.
|
||||
type RegisterUserJSONRequestBody = CreateUser
|
||||
Reference in New Issue
Block a user