dto

package
v0.0.0-...-0064678 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptFriendRequestRequest

type AcceptFriendRequestRequest struct {
	To   string `header:"User-Id" validate:"required"`
	From string `json:"from" validate:"required"`
}

type AcceptFriendRequestResponse

type AcceptFriendRequestResponse BasicResponse

type AuthTokenResponse

type AuthTokenResponse struct {
	AuthToken string `json:"auth_token"`
	CSRFToken string `json:"csrf_token"`
}

type AuthenticateThroughTelergamRequest

type AuthenticateThroughTelergamRequest struct {
	ID        string `query:"id" validate:"required"`
	FirstName string `query:"first_name" validate:"required"`
	LastName  string `query:"last_name" validate:"required"`
	PhotoURL  string `query:"photo_url"`
}

type Author

type Author struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Image string `json:"image"`
	Type  string `json:"type"`
}

type BasicResponse

type BasicResponse struct{}

type CheckDialogRequest

type CheckDialogRequest struct {
	UserID   string `json:"user_id"`
	DialogID string `json:"dialog_id"`
}

type Comment

type Comment struct {
	ID        string   `json:"id"`
	Author    User     `json:"author"`
	Message   string   `json:"message"`
	Images    []string `json:"images,omitempty"`
	CreatedAt int64    `json:"created_at"`
}

type Community

type Community struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Info  string `json:"info"`
	Image string `json:"image"`
}

Only used in responses! Does not need validation.

type CommunityProfile

type CommunityProfile struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Image     string `json:"image"`
	Info      string `json:"info"`
	Followers int64  `json:"followers"`
	Admins    []User `json:"admins"`
}

Only used in responses! Does not need validation.

type CreateChatRequest

type CreateChatRequest struct {
	UserID    string   `header:"User-Id" validate:"required"`
	Name      string   `json:"name"`
	AuthorIDs []string `json:"author_ids" validate:"required"`
}

type CreateChatResponse

type CreateChatResponse struct {
	DialogID string `json:"dialog_id"`
}

type CreateCommentRequest

type CreateCommentRequest struct {
	PostID  string   `json:"post_id" validate:"required"`
	Message string   `json:"message" validate:"required"`
	Images  []string `json:"images,omitempty"`
}

type CreateCommentResponse

type CreateCommentResponse BasicResponse

type CreateCommunityRequest

type CreateCommunityRequest struct {
	Name   string   `json:"name" validate:"required"`
	Image  string   `json:"image"`
	Info   string   `json:"info" validate:"required"`
	Admins []string `json:"admins"`
}

type CreateCommunityResponse

type CreateCommunityResponse BasicResponse

type CreatePostCommunityRequest

type CreatePostCommunityRequest struct {
	CommunityID string   `json:"community_id"`
	Message     string   `json:"message" validate:"required"`
	Images      []string `json:"images,omitempty"`
	Attachments []string `json:"attachments,omitempty"`
}

type CreatePostCommunityResponse

type CreatePostCommunityResponse BasicResponse

type CreatePostRequest

type CreatePostRequest struct {
	Message     string   `json:"message"`
	Images      []string `json:"images,omitempty"`
	Attachments []string `json:"attachments,omitempty"`
}

type CreatePostResponse

type CreatePostResponse BasicResponse

type DeleteCommentRequest

type DeleteCommentRequest struct {
	PostID    string `json:"post_id" validate:"required"`
	CommentID string `json:"comment_id" validate:"required"`
}

type DeleteCommentResponse

type DeleteCommentResponse struct{}

type DeleteCommunityRequest

type DeleteCommunityRequest struct {
	CommunityID string `query:"community_id"`
}

type DeleteCommunityResponse

type DeleteCommunityResponse BasicResponse

type DeleteFriendRequest

type DeleteFriendRequest struct {
	UserID   string `header:"User-Id" validate:"required"`
	FriendID string `query:"friend_id" validate:"required"`
}

type DeleteFriendResponse

type DeleteFriendResponse BasicResponse

type DeletePostCommunityRequest

type DeletePostCommunityRequest struct {
	CommunityID string `query:"community_id"`
	PostID      string `query:"post_id"`
}

type DeletePostCommunityResponse

type DeletePostCommunityResponse struct{}

type DeletePostRequest

type DeletePostRequest struct {
	PostID string `query:"post_id"`
}

type DeletePostResponse

type DeletePostResponse struct{}

type Dialog

type Dialog struct {
	DialogID     string   `json:"dialog_id"`
	Name         string   `json:"name"`
	Participants []string `json:"participants"`
	NonRead      int64    `json:"non_read"`
	Image        string   `json:"image"`
}

type EditCommentRequest

type EditCommentRequest struct {
	PostID    string   `json:"post_id" validate:"required"`
	CommentID string   `json:"comment_id" validate:"required"`
	Message   string   `json:"message"`
	Images    []string `json:"images,omitempty"`
}

type EditCommentResponse

type EditCommentResponse BasicResponse

type EditCommunityRequest

type EditCommunityRequest struct {
	CommunityID string   `json:"community_id"`
	Name        string   `json:"name"`
	Image       string   `json:"image"`
	Info        string   `json:"info"`
	Admins      []string `json:"admins"`
}

type EditCommunityResponse

type EditCommunityResponse BasicResponse

type EditPostCommunityRequest

type EditPostCommunityRequest struct {
	CommunityID string   `json:"community_id"`
	PostID      string   `json:"post_id"`
	Message     string   `json:"message"`
	Images      []string `json:"images,omitempty"`
	Attachments []string `json:"attachments,omitempty"`
}

type EditPostCommunityResponse

type EditPostCommunityResponse BasicResponse

type EditPostRequest

type EditPostRequest struct {
	PostID      string   `json:"post_id"`
	Message     string   `json:"message"`
	Images      []string `json:"images,omitempty"`
	Attachments []string `json:"attachments,omitempty"`
}

type EditPostResponse

type EditPostResponse BasicResponse

type EditProfile

type EditProfile struct {
	Name     common.UserName `json:"name"`
	Avatar   string          `json:"avatar"`
	Phone    string          `json:"phone"`
	Location string          `json:"location"`
	BirthDay string          `json:"birth_day"`
}

type EditProfileRequest

type EditProfileRequest struct {
	Name     common.UserName `json:"name"`
	Avatar   string          `json:"avatar"`
	Phone    string          `json:"phone"`
	Location string          `json:"location"`
	BirthDay string          `json:"birth_day"`
}

type EditProfileResponse

type EditProfileResponse BasicResponse

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type GetCommentsRequest

type GetCommentsRequest struct {
	PostID string `query:"post_id"`
	Limit  int64  `query:"limit,omitempty"`
	Page   int64  `query:"page,omitempty"`
}

type GetCommentsResponse

type GetCommentsResponse struct {
	Comments    []Comment `json:"comments"`
	Total       int64     `json:"total"`
	AmountPages int64     `json:"amount_pages"`
}

type GetCommunitiesRequest

type GetCommunitiesRequest struct {
	Limit int64 `query:"limit,omitempty"`
	Page  int64 `query:"page,omitempty"`
}

type GetCommunitiesResponse

type GetCommunitiesResponse struct {
	Communities []Community `json:"communities,omitempty"`
	Total       int64       `json:"total"`
	AmountPages int64       `json:"amount_pages"`
}

type GetCommunityPostsRequest

type GetCommunityPostsRequest struct {
	CommunityID string `query:"community_id"`
	Limit       int64  `query:"limit,omitempty"`
	Page        int64  `query:"page,omitempty"`
}

type GetCommunityPostsResponse

type GetCommunityPostsResponse struct {
	Posts       []GetPosts `json:"posts"`
	Total       int64      `json:"total"`
	AmountPages int64      `json:"amount_pages"`
}

type GetCommunityRequest

type GetCommunityRequest struct {
	CommunityID string `query:"community_id"`
}

type GetCommunityResponse

type GetCommunityResponse struct {
	Community CommunityProfile `json:"community,omitempty"`
}

type GetDialogByUserIDRequest

type GetDialogByUserIDRequest struct {
	UserID string `query:"user_id"`
}

type GetDialogByUserIDResponse

type GetDialogByUserIDResponse struct {
	DialogID string `json:"dialog_id"`
}

type GetDialogRequest

type GetDialogRequest struct {
	UserID   string
	DialogID string `query:"dialog_id"`
	Limit    int64  `query:"limit,omitempty"`
	Page     int64  `query:"page,omitempty"`
}

type GetDialogResponse

type GetDialogResponse struct {
	Dialog      Dialog        `json:"dialog"`
	Messages    []MessageInfo `json:"messages"`
	Total       int64         `json:"total"`
	AmountPages int64         `json:"amount_pages"`
}

type GetDialogsRequest

type GetDialogsRequest struct {
	UserID string `query:"user_id"`
	Limit  int64  `query:"limit,omitempty"`
	Page   int64  `query:"page,omitempty"`
}

type GetDialogsResponse

type GetDialogsResponse struct {
	Dialogs     []Dialog `json:"dialogs"`
	Total       int64    `json:"total"`
	AmountPages int64    `json:"amount_pages"`
}

type GetFileRequest

type GetFileRequest struct {
	URL string `query:"url" validate:"required"`
}

type GetFollowersRequest

type GetFollowersRequest struct {
	CommunityID string `query:"community_id" validate:"required"`
	Limit       int64  `query:"limit,omitempty"`
	Page        int64  `query:"page,omitempty"`
}

type GetFollowersResponse

type GetFollowersResponse struct {
	Amount      int64  `json:"amount"`
	Followers   []User `json:"followers"`
	Total       int64  `json:"total"`
	AmountPages int64  `json:"amount_pages"`
}

type GetFriendsRequest

type GetFriendsRequest struct {
	UserID      string `header:"User-Id" validate:"required"`
	QueryUserID string `query:"user_id"`
}

type GetFriendsResponse

type GetFriendsResponse struct {
	FriendIDs []string `json:"friend_ids"`
}

type GetIncomingRequestsRequest

type GetIncomingRequestsRequest struct {
	UserID string `header:"User-Id" validate:"required"`
}

type GetIncomingRequestsResponse

type GetIncomingRequestsResponse struct {
	RequestIDs []string `json:"request_ids"`
}

type GetLikePhotoRequest

type GetLikePhotoRequest struct {
	PhotoID string `query:"photo_id" validate:"required"`
}

type GetLikePhotoResponse

type GetLikePhotoResponse struct {
	Likes Like `json:"likes"`
}

type GetLikePostRequest

type GetLikePostRequest struct {
	PostID string `query:"post_id" validate:"required"`
}

type GetLikePostResponse

type GetLikePostResponse struct {
	Likes Like `json:"likes"`
}

type GetMutualFriendsRequest

type GetMutualFriendsRequest struct {
	CommunityID string `query:"community_id" validate:"required"`
	Limit       int64  `query:"limit,omitempty"`
	Page        int64  `query:"page,omitempty"`
}

type GetMutualFriendsResponse

type GetMutualFriendsResponse struct {
	Amount      int64  `json:"amount"`
	Followers   []User `json:"followers,omitempty"`
	Total       int64  `json:"total"`
	AmountPages int64  `json:"amount_pages"`
}

type GetOutcomingRequestsRequest

type GetOutcomingRequestsRequest struct {
	UserID string `header:"User-Id" validate:"required"`
}

type GetOutcomingRequestsResponse

type GetOutcomingRequestsResponse struct {
	RequestIDs []string `json:"request_ids"`
}

type GetPostRequest

type GetPostRequest struct {
	PostID string `query:"post_id" validate:"required"`
}

type GetPostResponse

type GetPostResponse struct {
	Post  Post `json:"post"`
	Likes Like `json:"likes"`
}

type GetPosts

type GetPosts struct {
	Post  Post `json:"post"`
	Likes Like `json:"likes"`
}

type GetProfileRequest

type GetProfileRequest struct {
	UserID string `query:"user_id"`
}

type GetProfileResponse

type GetProfileResponse struct {
	UserProfile UserProfile `json:"user_profile"`
}

type GetUserCommunitiesRequest

type GetUserCommunitiesRequest struct {
	UserID string `query:"user_id"`
	Limit  int64  `query:"limit,omitempty"`
	Page   int64  `query:"page,omitempty"`
}

type GetUserCommunitiesResponse

type GetUserCommunitiesResponse struct {
	Communities []Community `json:"communities,omitempty"`
	Total       int64       `json:"total"`
	AmountPages int64       `json:"amount_pages"`
}

type GetUserFeedRequest

type GetUserFeedRequest struct {
	Limit int64 `query:"limit,omitempty"`
	Page  int64 `query:"page,omitempty"`
}

type GetUserFeedResponse

type GetUserFeedResponse struct {
	Posts       []GetPosts `json:"posts"`
	Total       int64      `json:"total"`
	AmountPages int64      `json:"amount_pages"`
}

type GetUserManageCommunitiesRequest

type GetUserManageCommunitiesRequest struct {
	UserID string `query:"user_id"`
	Limit  int64  `query:"limit,omitempty"`
	Page   int64  `query:"page,omitempty"`
}

type GetUserManageCommunitiesResponse

type GetUserManageCommunitiesResponse struct {
	Communities []Community `json:"communities,omitempty"`
	Total       int64       `json:"total"`
	AmountPages int64       `json:"amount_pages"`
}

type GetUserPostsRequest

type GetUserPostsRequest struct {
	UserID string `query:"user_id"`
	Limit  int64  `query:"limit,omitempty"`
	Page   int64  `query:"page,omitempty"`
}

type GetUserPostsResponse

type GetUserPostsResponse struct {
	Posts       []GetPosts `json:"posts"`
	Total       int64      `json:"total"`
	AmountPages int64      `json:"amount_pages"`
}

type GetUserRequest

type GetUserRequest struct {
	UserID string `query:"user_id"`
}

type GetUserResponse

type GetUserResponse struct {
	User User `json:"user"`
}

type IncreaseLikeRequest

type IncreaseLikeRequest struct {
	PostID  string `json:"post_id,omitempty"`
	PhotoID string `json:"photo_id,omitempty"`
}

type IncreaseLikeResponse

type IncreaseLikeResponse BasicResponse

type JoinCommunityRequest

type JoinCommunityRequest struct {
	CommunityID string `query:"community_id" validate:"required"`
}

type JoinCommunityResponse

type JoinCommunityResponse BasicResponse

type LeaveCommunityRequest

type LeaveCommunityRequest struct {
	CommunityID string `query:"community_id" validate:"required"`
}

type LeaveCommunityResponse

type LeaveCommunityResponse BasicResponse

type Like

type Like struct {
	Amount  int64    `json:"amount"`
	MyLike  bool     `json:"my_like"`
	UserIDs []string `json:"user_ids,omitempty"`
}

Only used in responses! Does not need validation.

type LoginUserRequest

type LoginUserRequest struct {
	Email    string `json:"email"    validate:"required,email"`
	Password string `json:"password" validate:"required"`
}

type LoginUserResponse

type LoginUserResponse AuthTokenResponse

type Message

type Message struct {
	ID          string   `json:"_id"`
	DialogID    string   `json:"dialog_id"`
	Event       string   `json:"event"`
	AuthorID    string   `json:"author_id"`
	DestinID    string   `json:"dst,omitempty"`
	Body        string   `json:"body"`
	Attachments []string `json:"attachments"`
	Images      []string `json:"images"`
	CreatedAt   int64    `json:"created_at"`
}

Message for chat for wb

type MessageInfo

type MessageInfo struct {
	AuthorID    string        `json:"author_id"`
	Body        string        `json:"body"`
	IsRead      []core.IsRead `json:"is_read,omitempty"`
	Attachments []string      `json:"attachments"`
	Images      []string      `json:"images"`
	CreatedAt   int64         `json:"created_at"`
}

Message for chat for giving

type Post

type Post struct {
	ID            string   `json:"id"`
	Author        Author   `json:"author"`
	Message       string   `json:"message"`
	Images        []string `json:"images,omitempty"`
	Attachments   []string `json:"attachments,omitempty"`
	CountComments int64    `json:"count_comments"`
	CreatedAt     int64    `json:"created_at"`
}

type ReadMessageRequest

type ReadMessageRequest struct {
	Message Message `json:"message"`
}

type ReadMessageResponse

type ReadMessageResponse struct{}

type ReduceLikeRequest

type ReduceLikeRequest struct {
	PostID  string `json:"post_id,omitempty"`
	PhotoID string `json:"photo_id,omitempty"`
}

type ReduceLikeResponse

type ReduceLikeResponse BasicResponse

type RevokeFriendRequestRequest

type RevokeFriendRequestRequest struct {
	From string `header:"User-Id" validate:"required"`
	To   string `json:"to" validate:"required"`
}

type RevokeFriendRequestResponse

type RevokeFriendRequestResponse BasicResponse

type SearchCommunitiesRequest

type SearchCommunitiesRequest struct {
	Selector string `query:"selector" validate:"required"`
	Limit    int64  `query:"limit,omitempty"`
	Page     int64  `query:"page,omitempty"`
}

type SearchCommunitiesResponse

type SearchCommunitiesResponse struct {
	Communities []Community `json:"communities,omitempty"`
	Total       int64       `json:"total"`
	AmountPages int64       `json:"amount_pages"`
}

type SearchUsersRequest

type SearchUsersRequest struct {
	Selector string `query:"selector" validate:"required"`
	Limit    int64  `query:"limit,omitempty"`
	Page     int64  `query:"page,omitempty"`
}

type SearchUsersResponse

type SearchUsersResponse struct {
	Users       []User `json:"users"`
	Total       int64  `json:"total"`
	AmountPages int64  `json:"amount_pages"`
}

type SendFriendRequestRequest

type SendFriendRequestRequest struct {
	From string `header:"User-Id" validate:"required"`
	To   string `json:"to" validate:"required"`
}

type SendFriendRequestResponse

type SendFriendRequestResponse BasicResponse

type SendMessageRequest

type SendMessageRequest struct {
	Message Message `json:"message"`
}

type SendMessageResponse

type SendMessageResponse struct{}

type SignupUserRequest

type SignupUserRequest struct {
	Name     common.UserName `json:"name"`
	Email    string          `json:"email"    validate:"required,email"`
	Password string          `json:"password" validate:"required"`
}

type SignupUserResponse

type SignupUserResponse AuthTokenResponse

type UpdatePhotoCommunityRequest

type UpdatePhotoCommunityRequest struct {
	CommunityID string `query:"community_id" validate:"required"`
}

type UpdatePhotoCommunityResponse

type UpdatePhotoCommunityResponse struct {
	URL string `json:"url"`
}

type UpdatePhotoRequest

type UpdatePhotoRequest struct{}

type UpdatePhotoResponse

type UpdatePhotoResponse struct {
	URL string `json:"url"`
}

type UploadFileResponse

type UploadFileResponse struct {
	URL string `json:"url"`
}

type UploadImageResponse

type UploadImageResponse struct {
	URL string `json:"url"`
}

type User

type User struct {
	ID    string          `json:"id"`
	Email string          `json:"email"`
	Name  common.UserName `json:"name"`
	Image string          `json:"image"`
}

Only used in responses! Does not need validation.

type UserProfile

type UserProfile struct {
	ID       string          `json:"id"`
	Email    string          `json:"email"`
	Name     common.UserName `json:"name"`
	Avatar   string          `json:"avatar"`
	Phone    string          `json:"phone"`
	Location string          `json:"location"`
	BirthDay string          `json:"birth_day"`
}

Add status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL