diff --git a/gen/chat/chat.ts b/gen/chat/chat.ts index 400c88f..12520b1 100644 --- a/gen/chat/chat.ts +++ b/gen/chat/chat.ts @@ -15,16 +15,25 @@ export interface MessageDto { id: string; chatId: string; senderId: string; - /** TEXT, VOICE, VIDEO_NOTE, STICKER */ + /** TEXT, VOICE, VIDEO_NOTE, STICKER, IMAGE */ type: string; + /** Для текста - сам текст. Для медиа - URL S3! */ content: string; - /** JSON string */ + /** Ширина/высота картинки, длительность войса (JSON string) */ metadata: string; replyToId: string; isEdited: boolean; createdAt: string; } +export interface ChatMemberDto { + accountId: string; + /** OWNER, ADMIN, MEMBER */ + role: string; + isMuted: boolean; + joinedAt: string; +} + export interface ChatDto { id: string; /** DIRECT, GROUP, CHANNEL */ @@ -32,18 +41,17 @@ export interface ChatDto { title: string; avatarUrl: string; unreadCount: number; - /** Нужно для рендера списка чатов слева! */ - lastMessage: MessageDto | undefined; + lastMessage: + | MessageDto + | undefined; + /** Полезно для рендера иконки перечеркнутого колокольчика */ + isMuted: boolean; } export interface CreateChatRequest { - /** ID того кто создает */ creatorId: string; - /** GROUP, DIRECT, CHANNEL */ type: string; - /** Имя (при type=GROUP|CHANNEL) */ title: string; - /** Кого сразу добавить (собеседник в личке или юзеры в группе) */ participantIds: string[]; } @@ -53,7 +61,6 @@ export interface CreateChatResponse { export interface GetUserChatsRequest { userId: string; - /** для пагинации (бесконечный скролл в левой панели) */ offset: number; limit: number; } @@ -62,9 +69,24 @@ export interface GetUserChatsResponse { chats: ChatDto[]; } +/** Получаем профили всех участников и ссылку-приглашение (join_hash) */ +export interface GetChatDetailsRequest { + userId: string; + chatId: string; +} + +export interface GetChatDetailsResponse { + chat: + | ChatDto + | undefined; + /** Для ссылки-приглашения (t.me/join/...) */ + joinHash: string; + members: ChatMemberDto[]; +} + export interface JoinChatRequest { userId: string; - /** либо join_hash */ + /** Передаем либо chat_id, либо вытаскиваем его из join_hash */ chatId: string; } @@ -81,11 +103,33 @@ export interface LeaveChatResponse { success: boolean; } +export interface RemoveMemberRequest { + /** Кто кикает (нужно проверить права) */ + adminId: string; + /** Кого кикают */ + targetUserId: string; + chatId: string; +} + +export interface RemoveMemberResponse { + success: boolean; +} + +export interface MuteChatRequest { + userId: string; + chatId: string; + /** true = выключить звук, false = включить */ + isMuted: boolean; +} + +export interface MuteChatResponse { + success: boolean; +} + export interface GetMessagesRequest { userId: string; chatId: string; limit: number; - /** курсорная пагинация, как в Telegram */ beforeMsgId: string; } @@ -101,10 +145,16 @@ export interface SendMessageRequest { replyToId: string; } +export interface EditMessageRequest { + userId: string; + messageId: string; + newContent: string; +} + export interface DeleteMessageRequest { userId: string; messageId: string; - /** "Удалить для всех" */ + /** "Удалить только у себя" или "Удалить для всех" */ forEveryone: boolean; } @@ -115,6 +165,7 @@ export interface DeleteMessageResponse { export interface MarkAsReadRequest { userId: string; chatId: string; + /** ID последнего видимого сообщения */ messageId: string; } @@ -125,24 +176,40 @@ export interface MarkAsReadResponse { export const CHAT_V1_PACKAGE_NAME = "chat.v1"; export interface ChatServiceClient { - /** Управление чатами */ + /** Управление чатами (левая панель) */ createChat(request: CreateChatRequest, metadata?: Metadata): Observable; getUserChats(request: GetUserChatsRequest, metadata?: Metadata): Observable; + /** Открытие инфы о группе/собеседнике */ + + getChatDetails(request: GetChatDetailsRequest, metadata?: Metadata): Observable; + + /** Управление участниками группы */ + joinChat(request: JoinChatRequest, metadata?: Metadata): Observable; leaveChat(request: LeaveChatRequest, metadata?: Metadata): Observable; - /** Управление сообщениями (история) */ + /** Админ кикает пользователя */ + + removeMember(request: RemoveMemberRequest, metadata?: Metadata): Observable; + + /** Выключить/включить пуши для чата */ + + muteChat(request: MuteChatRequest, metadata?: Metadata): Observable; + + /** Управление сообщениями (правое окно) */ getMessages(request: GetMessagesRequest, metadata?: Metadata): Observable; - /** вызывается либо из Gateway (для фото/аудио), либо напрямую */ - sendMessage(request: SendMessageRequest, metadata?: Metadata): Observable; + /** Новое */ + + editMessage(request: EditMessageRequest, metadata?: Metadata): Observable; + deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable; /** Статусы */ @@ -151,7 +218,7 @@ export interface ChatServiceClient { } export interface ChatServiceController { - /** Управление чатами */ + /** Управление чатами (левая панель) */ createChat( request: CreateChatRequest, @@ -163,6 +230,15 @@ export interface ChatServiceController { metadata?: Metadata, ): Promise | Observable | GetUserChatsResponse; + /** Открытие инфы о группе/собеседнике */ + + getChatDetails( + request: GetChatDetailsRequest, + metadata?: Metadata, + ): Promise | Observable | GetChatDetailsResponse; + + /** Управление участниками группы */ + joinChat( request: JoinChatRequest, metadata?: Metadata, @@ -173,20 +249,39 @@ export interface ChatServiceController { metadata?: Metadata, ): Promise | Observable | LeaveChatResponse; - /** Управление сообщениями (история) */ + /** Админ кикает пользователя */ + + removeMember( + request: RemoveMemberRequest, + metadata?: Metadata, + ): Promise | Observable | RemoveMemberResponse; + + /** Выключить/включить пуши для чата */ + + muteChat( + request: MuteChatRequest, + metadata?: Metadata, + ): Promise | Observable | MuteChatResponse; + + /** Управление сообщениями (правое окно) */ getMessages( request: GetMessagesRequest, metadata?: Metadata, ): Promise | Observable | GetMessagesResponse; - /** вызывается либо из Gateway (для фото/аудио), либо напрямую */ - sendMessage( request: SendMessageRequest, metadata?: Metadata, ): Promise | Observable | MessageDto; + /** Новое */ + + editMessage( + request: EditMessageRequest, + metadata?: Metadata, + ): Promise | Observable | MessageDto; + deleteMessage( request: DeleteMessageRequest, metadata?: Metadata, @@ -205,10 +300,14 @@ export function ChatServiceControllerMethods() { const grpcMethods: string[] = [ "createChat", "getUserChats", + "getChatDetails", "joinChat", "leaveChat", + "removeMember", + "muteChat", "getMessages", "sendMessage", + "editMessage", "deleteMessage", "markAsRead", ]; diff --git a/gen/go/chat/chat.pb.go b/gen/go/chat/chat.pb.go index 3cdd0f7..fef477b 100644 --- a/gen/go/chat/chat.pb.go +++ b/gen/go/chat/chat.pb.go @@ -26,9 +26,9 @@ type MessageDto struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ChatId string `protobuf:"bytes,2,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` SenderId string `protobuf:"bytes,3,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` // TEXT, VOICE, VIDEO_NOTE, STICKER - Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` - Metadata string `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` // JSON string + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` // TEXT, VOICE, VIDEO_NOTE, STICKER, IMAGE + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` // Для текста - сам текст. Для медиа - URL S3! + Metadata string `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` // Ширина/высота картинки, длительность войса (JSON string) ReplyToId string `protobuf:"bytes,7,opt,name=reply_to_id,json=replyToId,proto3" json:"reply_to_id,omitempty"` IsEdited bool `protobuf:"varint,8,opt,name=is_edited,json=isEdited,proto3" json:"is_edited,omitempty"` CreatedAt string `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` @@ -129,6 +129,74 @@ func (x *MessageDto) GetCreatedAt() string { return "" } +type ChatMemberDto struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` // OWNER, ADMIN, MEMBER + IsMuted bool `protobuf:"varint,3,opt,name=is_muted,json=isMuted,proto3" json:"is_muted,omitempty"` + JoinedAt string `protobuf:"bytes,4,opt,name=joined_at,json=joinedAt,proto3" json:"joined_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChatMemberDto) Reset() { + *x = ChatMemberDto{} + mi := &file_chat_chat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChatMemberDto) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatMemberDto) ProtoMessage() {} + +func (x *ChatMemberDto) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChatMemberDto.ProtoReflect.Descriptor instead. +func (*ChatMemberDto) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{1} +} + +func (x *ChatMemberDto) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +func (x *ChatMemberDto) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *ChatMemberDto) GetIsMuted() bool { + if x != nil { + return x.IsMuted + } + return false +} + +func (x *ChatMemberDto) GetJoinedAt() string { + if x != nil { + return x.JoinedAt + } + return "" +} + type ChatDto struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -136,14 +204,15 @@ type ChatDto struct { Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` UnreadCount int32 `protobuf:"varint,5,opt,name=unread_count,json=unreadCount,proto3" json:"unread_count,omitempty"` - LastMessage *MessageDto `protobuf:"bytes,6,opt,name=last_message,json=lastMessage,proto3" json:"last_message,omitempty"` // Нужно для рендера списка чатов слева! + LastMessage *MessageDto `protobuf:"bytes,6,opt,name=last_message,json=lastMessage,proto3" json:"last_message,omitempty"` + IsMuted bool `protobuf:"varint,7,opt,name=is_muted,json=isMuted,proto3" json:"is_muted,omitempty"` // Полезно для рендера иконки перечеркнутого колокольчика unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ChatDto) Reset() { *x = ChatDto{} - mi := &file_chat_chat_proto_msgTypes[1] + mi := &file_chat_chat_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -155,7 +224,7 @@ func (x *ChatDto) String() string { func (*ChatDto) ProtoMessage() {} func (x *ChatDto) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[1] + mi := &file_chat_chat_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -168,7 +237,7 @@ func (x *ChatDto) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatDto.ProtoReflect.Descriptor instead. func (*ChatDto) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{1} + return file_chat_chat_proto_rawDescGZIP(), []int{2} } func (x *ChatDto) GetId() string { @@ -213,19 +282,26 @@ func (x *ChatDto) GetLastMessage() *MessageDto { return nil } +func (x *ChatDto) GetIsMuted() bool { + if x != nil { + return x.IsMuted + } + return false +} + type CreateChatRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - CreatorId string `protobuf:"bytes,1,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` // ID того кто создает - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // GROUP, DIRECT, CHANNEL - Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // Имя (при type=GROUP|CHANNEL) - ParticipantIds []string `protobuf:"bytes,4,rep,name=participant_ids,json=participantIds,proto3" json:"participant_ids,omitempty"` // Кого сразу добавить (собеседник в личке или юзеры в группе) + CreatorId string `protobuf:"bytes,1,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + ParticipantIds []string `protobuf:"bytes,4,rep,name=participant_ids,json=participantIds,proto3" json:"participant_ids,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CreateChatRequest) Reset() { *x = CreateChatRequest{} - mi := &file_chat_chat_proto_msgTypes[2] + mi := &file_chat_chat_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -237,7 +313,7 @@ func (x *CreateChatRequest) String() string { func (*CreateChatRequest) ProtoMessage() {} func (x *CreateChatRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[2] + mi := &file_chat_chat_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -250,7 +326,7 @@ func (x *CreateChatRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateChatRequest.ProtoReflect.Descriptor instead. func (*CreateChatRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{2} + return file_chat_chat_proto_rawDescGZIP(), []int{3} } func (x *CreateChatRequest) GetCreatorId() string { @@ -290,7 +366,7 @@ type CreateChatResponse struct { func (x *CreateChatResponse) Reset() { *x = CreateChatResponse{} - mi := &file_chat_chat_proto_msgTypes[3] + mi := &file_chat_chat_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -302,7 +378,7 @@ func (x *CreateChatResponse) String() string { func (*CreateChatResponse) ProtoMessage() {} func (x *CreateChatResponse) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[3] + mi := &file_chat_chat_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -315,7 +391,7 @@ func (x *CreateChatResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateChatResponse.ProtoReflect.Descriptor instead. func (*CreateChatResponse) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{3} + return file_chat_chat_proto_rawDescGZIP(), []int{4} } func (x *CreateChatResponse) GetChat() *ChatDto { @@ -328,7 +404,7 @@ func (x *CreateChatResponse) GetChat() *ChatDto { type GetUserChatsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // для пагинации (бесконечный скролл в левой панели) + Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -336,7 +412,7 @@ type GetUserChatsRequest struct { func (x *GetUserChatsRequest) Reset() { *x = GetUserChatsRequest{} - mi := &file_chat_chat_proto_msgTypes[4] + mi := &file_chat_chat_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -348,7 +424,7 @@ func (x *GetUserChatsRequest) String() string { func (*GetUserChatsRequest) ProtoMessage() {} func (x *GetUserChatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[4] + mi := &file_chat_chat_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -361,7 +437,7 @@ func (x *GetUserChatsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserChatsRequest.ProtoReflect.Descriptor instead. func (*GetUserChatsRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{4} + return file_chat_chat_proto_rawDescGZIP(), []int{5} } func (x *GetUserChatsRequest) GetUserId() string { @@ -394,7 +470,7 @@ type GetUserChatsResponse struct { func (x *GetUserChatsResponse) Reset() { *x = GetUserChatsResponse{} - mi := &file_chat_chat_proto_msgTypes[5] + mi := &file_chat_chat_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -406,7 +482,7 @@ func (x *GetUserChatsResponse) String() string { func (*GetUserChatsResponse) ProtoMessage() {} func (x *GetUserChatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[5] + mi := &file_chat_chat_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -419,7 +495,7 @@ func (x *GetUserChatsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserChatsResponse.ProtoReflect.Descriptor instead. func (*GetUserChatsResponse) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{5} + return file_chat_chat_proto_rawDescGZIP(), []int{6} } func (x *GetUserChatsResponse) GetChats() []*ChatDto { @@ -429,17 +505,130 @@ func (x *GetUserChatsResponse) GetChats() []*ChatDto { return nil } +// Получаем профили всех участников и ссылку-приглашение (join_hash) +type GetChatDetailsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + ChatId string `protobuf:"bytes,2,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetChatDetailsRequest) Reset() { + *x = GetChatDetailsRequest{} + mi := &file_chat_chat_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetChatDetailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChatDetailsRequest) ProtoMessage() {} + +func (x *GetChatDetailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChatDetailsRequest.ProtoReflect.Descriptor instead. +func (*GetChatDetailsRequest) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{7} +} + +func (x *GetChatDetailsRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetChatDetailsRequest) GetChatId() string { + if x != nil { + return x.ChatId + } + return "" +} + +type GetChatDetailsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Chat *ChatDto `protobuf:"bytes,1,opt,name=chat,proto3" json:"chat,omitempty"` + JoinHash string `protobuf:"bytes,2,opt,name=join_hash,json=joinHash,proto3" json:"join_hash,omitempty"` // Для ссылки-приглашения (t.me/join/...) + Members []*ChatMemberDto `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetChatDetailsResponse) Reset() { + *x = GetChatDetailsResponse{} + mi := &file_chat_chat_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetChatDetailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChatDetailsResponse) ProtoMessage() {} + +func (x *GetChatDetailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChatDetailsResponse.ProtoReflect.Descriptor instead. +func (*GetChatDetailsResponse) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{8} +} + +func (x *GetChatDetailsResponse) GetChat() *ChatDto { + if x != nil { + return x.Chat + } + return nil +} + +func (x *GetChatDetailsResponse) GetJoinHash() string { + if x != nil { + return x.JoinHash + } + return "" +} + +func (x *GetChatDetailsResponse) GetMembers() []*ChatMemberDto { + if x != nil { + return x.Members + } + return nil +} + type JoinChatRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - ChatId string `protobuf:"bytes,2,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` // либо join_hash + ChatId string `protobuf:"bytes,2,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` // Передаем либо chat_id, либо вытаскиваем его из join_hash unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *JoinChatRequest) Reset() { *x = JoinChatRequest{} - mi := &file_chat_chat_proto_msgTypes[6] + mi := &file_chat_chat_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -451,7 +640,7 @@ func (x *JoinChatRequest) String() string { func (*JoinChatRequest) ProtoMessage() {} func (x *JoinChatRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[6] + mi := &file_chat_chat_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -464,7 +653,7 @@ func (x *JoinChatRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use JoinChatRequest.ProtoReflect.Descriptor instead. func (*JoinChatRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{6} + return file_chat_chat_proto_rawDescGZIP(), []int{9} } func (x *JoinChatRequest) GetUserId() string { @@ -490,7 +679,7 @@ type JoinChatResponse struct { func (x *JoinChatResponse) Reset() { *x = JoinChatResponse{} - mi := &file_chat_chat_proto_msgTypes[7] + mi := &file_chat_chat_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -502,7 +691,7 @@ func (x *JoinChatResponse) String() string { func (*JoinChatResponse) ProtoMessage() {} func (x *JoinChatResponse) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[7] + mi := &file_chat_chat_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +704,7 @@ func (x *JoinChatResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use JoinChatResponse.ProtoReflect.Descriptor instead. func (*JoinChatResponse) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{7} + return file_chat_chat_proto_rawDescGZIP(), []int{10} } func (x *JoinChatResponse) GetSuccess() bool { @@ -535,7 +724,7 @@ type LeaveChatRequest struct { func (x *LeaveChatRequest) Reset() { *x = LeaveChatRequest{} - mi := &file_chat_chat_proto_msgTypes[8] + mi := &file_chat_chat_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -547,7 +736,7 @@ func (x *LeaveChatRequest) String() string { func (*LeaveChatRequest) ProtoMessage() {} func (x *LeaveChatRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[8] + mi := &file_chat_chat_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -560,7 +749,7 @@ func (x *LeaveChatRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LeaveChatRequest.ProtoReflect.Descriptor instead. func (*LeaveChatRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{8} + return file_chat_chat_proto_rawDescGZIP(), []int{11} } func (x *LeaveChatRequest) GetUserId() string { @@ -586,7 +775,7 @@ type LeaveChatResponse struct { func (x *LeaveChatResponse) Reset() { *x = LeaveChatResponse{} - mi := &file_chat_chat_proto_msgTypes[9] + mi := &file_chat_chat_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -598,7 +787,7 @@ func (x *LeaveChatResponse) String() string { func (*LeaveChatResponse) ProtoMessage() {} func (x *LeaveChatResponse) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[9] + mi := &file_chat_chat_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -611,7 +800,7 @@ func (x *LeaveChatResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LeaveChatResponse.ProtoReflect.Descriptor instead. func (*LeaveChatResponse) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{9} + return file_chat_chat_proto_rawDescGZIP(), []int{12} } func (x *LeaveChatResponse) GetSuccess() bool { @@ -621,19 +810,227 @@ func (x *LeaveChatResponse) GetSuccess() bool { return false } +type RemoveMemberRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AdminId string `protobuf:"bytes,1,opt,name=admin_id,json=adminId,proto3" json:"admin_id,omitempty"` // Кто кикает (нужно проверить права) + TargetUserId string `protobuf:"bytes,2,opt,name=target_user_id,json=targetUserId,proto3" json:"target_user_id,omitempty"` // Кого кикают + ChatId string `protobuf:"bytes,3,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveMemberRequest) Reset() { + *x = RemoveMemberRequest{} + mi := &file_chat_chat_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveMemberRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveMemberRequest) ProtoMessage() {} + +func (x *RemoveMemberRequest) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveMemberRequest.ProtoReflect.Descriptor instead. +func (*RemoveMemberRequest) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{13} +} + +func (x *RemoveMemberRequest) GetAdminId() string { + if x != nil { + return x.AdminId + } + return "" +} + +func (x *RemoveMemberRequest) GetTargetUserId() string { + if x != nil { + return x.TargetUserId + } + return "" +} + +func (x *RemoveMemberRequest) GetChatId() string { + if x != nil { + return x.ChatId + } + return "" +} + +type RemoveMemberResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveMemberResponse) Reset() { + *x = RemoveMemberResponse{} + mi := &file_chat_chat_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveMemberResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveMemberResponse) ProtoMessage() {} + +func (x *RemoveMemberResponse) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveMemberResponse.ProtoReflect.Descriptor instead. +func (*RemoveMemberResponse) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{14} +} + +func (x *RemoveMemberResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type MuteChatRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + ChatId string `protobuf:"bytes,2,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` + IsMuted bool `protobuf:"varint,3,opt,name=is_muted,json=isMuted,proto3" json:"is_muted,omitempty"` // true = выключить звук, false = включить + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MuteChatRequest) Reset() { + *x = MuteChatRequest{} + mi := &file_chat_chat_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MuteChatRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MuteChatRequest) ProtoMessage() {} + +func (x *MuteChatRequest) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MuteChatRequest.ProtoReflect.Descriptor instead. +func (*MuteChatRequest) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{15} +} + +func (x *MuteChatRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *MuteChatRequest) GetChatId() string { + if x != nil { + return x.ChatId + } + return "" +} + +func (x *MuteChatRequest) GetIsMuted() bool { + if x != nil { + return x.IsMuted + } + return false +} + +type MuteChatResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MuteChatResponse) Reset() { + *x = MuteChatResponse{} + mi := &file_chat_chat_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MuteChatResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MuteChatResponse) ProtoMessage() {} + +func (x *MuteChatResponse) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MuteChatResponse.ProtoReflect.Descriptor instead. +func (*MuteChatResponse) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{16} +} + +func (x *MuteChatResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + type GetMessagesRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` ChatId string `protobuf:"bytes,2,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - BeforeMsgId string `protobuf:"bytes,4,opt,name=before_msg_id,json=beforeMsgId,proto3" json:"before_msg_id,omitempty"` // курсорная пагинация, как в Telegram + BeforeMsgId string `protobuf:"bytes,4,opt,name=before_msg_id,json=beforeMsgId,proto3" json:"before_msg_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GetMessagesRequest) Reset() { *x = GetMessagesRequest{} - mi := &file_chat_chat_proto_msgTypes[10] + mi := &file_chat_chat_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -645,7 +1042,7 @@ func (x *GetMessagesRequest) String() string { func (*GetMessagesRequest) ProtoMessage() {} func (x *GetMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[10] + mi := &file_chat_chat_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -658,7 +1055,7 @@ func (x *GetMessagesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMessagesRequest.ProtoReflect.Descriptor instead. func (*GetMessagesRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{10} + return file_chat_chat_proto_rawDescGZIP(), []int{17} } func (x *GetMessagesRequest) GetUserId() string { @@ -698,7 +1095,7 @@ type GetMessagesResponse struct { func (x *GetMessagesResponse) Reset() { *x = GetMessagesResponse{} - mi := &file_chat_chat_proto_msgTypes[11] + mi := &file_chat_chat_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -710,7 +1107,7 @@ func (x *GetMessagesResponse) String() string { func (*GetMessagesResponse) ProtoMessage() {} func (x *GetMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[11] + mi := &file_chat_chat_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -723,7 +1120,7 @@ func (x *GetMessagesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMessagesResponse.ProtoReflect.Descriptor instead. func (*GetMessagesResponse) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{11} + return file_chat_chat_proto_rawDescGZIP(), []int{18} } func (x *GetMessagesResponse) GetMessages() []*MessageDto { @@ -746,7 +1143,7 @@ type SendMessageRequest struct { func (x *SendMessageRequest) Reset() { *x = SendMessageRequest{} - mi := &file_chat_chat_proto_msgTypes[12] + mi := &file_chat_chat_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -758,7 +1155,7 @@ func (x *SendMessageRequest) String() string { func (*SendMessageRequest) ProtoMessage() {} func (x *SendMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[12] + mi := &file_chat_chat_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -771,7 +1168,7 @@ func (x *SendMessageRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SendMessageRequest.ProtoReflect.Descriptor instead. func (*SendMessageRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{12} + return file_chat_chat_proto_rawDescGZIP(), []int{19} } func (x *SendMessageRequest) GetChatId() string { @@ -809,18 +1206,78 @@ func (x *SendMessageRequest) GetReplyToId() string { return "" } +type EditMessageRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + NewContent string `protobuf:"bytes,3,opt,name=new_content,json=newContent,proto3" json:"new_content,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EditMessageRequest) Reset() { + *x = EditMessageRequest{} + mi := &file_chat_chat_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EditMessageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditMessageRequest) ProtoMessage() {} + +func (x *EditMessageRequest) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditMessageRequest.ProtoReflect.Descriptor instead. +func (*EditMessageRequest) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{20} +} + +func (x *EditMessageRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *EditMessageRequest) GetMessageId() string { + if x != nil { + return x.MessageId + } + return "" +} + +func (x *EditMessageRequest) GetNewContent() string { + if x != nil { + return x.NewContent + } + return "" +} + type DeleteMessageRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` - ForEveryone bool `protobuf:"varint,3,opt,name=for_everyone,json=forEveryone,proto3" json:"for_everyone,omitempty"` // "Удалить для всех" + ForEveryone bool `protobuf:"varint,3,opt,name=for_everyone,json=forEveryone,proto3" json:"for_everyone,omitempty"` // "Удалить только у себя" или "Удалить для всех" unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *DeleteMessageRequest) Reset() { *x = DeleteMessageRequest{} - mi := &file_chat_chat_proto_msgTypes[13] + mi := &file_chat_chat_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -832,7 +1289,7 @@ func (x *DeleteMessageRequest) String() string { func (*DeleteMessageRequest) ProtoMessage() {} func (x *DeleteMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[13] + mi := &file_chat_chat_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -845,7 +1302,7 @@ func (x *DeleteMessageRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteMessageRequest.ProtoReflect.Descriptor instead. func (*DeleteMessageRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{13} + return file_chat_chat_proto_rawDescGZIP(), []int{21} } func (x *DeleteMessageRequest) GetUserId() string { @@ -878,7 +1335,7 @@ type DeleteMessageResponse struct { func (x *DeleteMessageResponse) Reset() { *x = DeleteMessageResponse{} - mi := &file_chat_chat_proto_msgTypes[14] + mi := &file_chat_chat_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -890,7 +1347,7 @@ func (x *DeleteMessageResponse) String() string { func (*DeleteMessageResponse) ProtoMessage() {} func (x *DeleteMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[14] + mi := &file_chat_chat_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -903,7 +1360,7 @@ func (x *DeleteMessageResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteMessageResponse.ProtoReflect.Descriptor instead. func (*DeleteMessageResponse) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{14} + return file_chat_chat_proto_rawDescGZIP(), []int{22} } func (x *DeleteMessageResponse) GetSuccess() bool { @@ -917,14 +1374,14 @@ type MarkAsReadRequest struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` ChatId string `protobuf:"bytes,2,opt,name=chat_id,json=chatId,proto3" json:"chat_id,omitempty"` - MessageId string `protobuf:"bytes,3,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + MessageId string `protobuf:"bytes,3,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` // ID последнего видимого сообщения unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *MarkAsReadRequest) Reset() { *x = MarkAsReadRequest{} - mi := &file_chat_chat_proto_msgTypes[15] + mi := &file_chat_chat_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -936,7 +1393,7 @@ func (x *MarkAsReadRequest) String() string { func (*MarkAsReadRequest) ProtoMessage() {} func (x *MarkAsReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[15] + mi := &file_chat_chat_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -949,7 +1406,7 @@ func (x *MarkAsReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkAsReadRequest.ProtoReflect.Descriptor instead. func (*MarkAsReadRequest) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{15} + return file_chat_chat_proto_rawDescGZIP(), []int{23} } func (x *MarkAsReadRequest) GetUserId() string { @@ -982,7 +1439,7 @@ type MarkAsReadResponse struct { func (x *MarkAsReadResponse) Reset() { *x = MarkAsReadResponse{} - mi := &file_chat_chat_proto_msgTypes[16] + mi := &file_chat_chat_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -994,7 +1451,7 @@ func (x *MarkAsReadResponse) String() string { func (*MarkAsReadResponse) ProtoMessage() {} func (x *MarkAsReadResponse) ProtoReflect() protoreflect.Message { - mi := &file_chat_chat_proto_msgTypes[16] + mi := &file_chat_chat_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1007,7 +1464,7 @@ func (x *MarkAsReadResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkAsReadResponse.ProtoReflect.Descriptor instead. func (*MarkAsReadResponse) Descriptor() ([]byte, []int) { - return file_chat_chat_proto_rawDescGZIP(), []int{16} + return file_chat_chat_proto_rawDescGZIP(), []int{24} } func (x *MarkAsReadResponse) GetSuccess() bool { @@ -1033,7 +1490,13 @@ const file_chat_chat_proto_rawDesc = "" + "\vreply_to_id\x18\a \x01(\tR\treplyToId\x12\x1b\n" + "\tis_edited\x18\b \x01(\bR\bisEdited\x12\x1d\n" + "\n" + - "created_at\x18\t \x01(\tR\tcreatedAt\"\xbd\x01\n" + + "created_at\x18\t \x01(\tR\tcreatedAt\"z\n" + + "\rChatMemberDto\x12\x1d\n" + + "\n" + + "account_id\x18\x01 \x01(\tR\taccountId\x12\x12\n" + + "\x04role\x18\x02 \x01(\tR\x04role\x12\x19\n" + + "\bis_muted\x18\x03 \x01(\bR\aisMuted\x12\x1b\n" + + "\tjoined_at\x18\x04 \x01(\tR\bjoinedAt\"\xd8\x01\n" + "\aChatDto\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04type\x18\x02 \x01(\tR\x04type\x12\x14\n" + @@ -1041,7 +1504,8 @@ const file_chat_chat_proto_rawDesc = "" + "\n" + "avatar_url\x18\x04 \x01(\tR\tavatarUrl\x12!\n" + "\funread_count\x18\x05 \x01(\x05R\vunreadCount\x126\n" + - "\flast_message\x18\x06 \x01(\v2\x13.chat.v1.MessageDtoR\vlastMessage\"\x85\x01\n" + + "\flast_message\x18\x06 \x01(\v2\x13.chat.v1.MessageDtoR\vlastMessage\x12\x19\n" + + "\bis_muted\x18\a \x01(\bR\aisMuted\"\x85\x01\n" + "\x11CreateChatRequest\x12\x1d\n" + "\n" + "creator_id\x18\x01 \x01(\tR\tcreatorId\x12\x12\n" + @@ -1055,7 +1519,14 @@ const file_chat_chat_proto_rawDesc = "" + "\x06offset\x18\x02 \x01(\x05R\x06offset\x12\x14\n" + "\x05limit\x18\x03 \x01(\x05R\x05limit\">\n" + "\x14GetUserChatsResponse\x12&\n" + - "\x05chats\x18\x01 \x03(\v2\x10.chat.v1.ChatDtoR\x05chats\"C\n" + + "\x05chats\x18\x01 \x03(\v2\x10.chat.v1.ChatDtoR\x05chats\"I\n" + + "\x15GetChatDetailsRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" + + "\achat_id\x18\x02 \x01(\tR\x06chatId\"\x8d\x01\n" + + "\x16GetChatDetailsResponse\x12$\n" + + "\x04chat\x18\x01 \x01(\v2\x10.chat.v1.ChatDtoR\x04chat\x12\x1b\n" + + "\tjoin_hash\x18\x02 \x01(\tR\bjoinHash\x120\n" + + "\amembers\x18\x03 \x03(\v2\x16.chat.v1.ChatMemberDtoR\amembers\"C\n" + "\x0fJoinChatRequest\x12\x17\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" + "\achat_id\x18\x02 \x01(\tR\x06chatId\",\n" + @@ -1065,6 +1536,18 @@ const file_chat_chat_proto_rawDesc = "" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" + "\achat_id\x18\x02 \x01(\tR\x06chatId\"-\n" + "\x11LeaveChatResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"o\n" + + "\x13RemoveMemberRequest\x12\x19\n" + + "\badmin_id\x18\x01 \x01(\tR\aadminId\x12$\n" + + "\x0etarget_user_id\x18\x02 \x01(\tR\ftargetUserId\x12\x17\n" + + "\achat_id\x18\x03 \x01(\tR\x06chatId\"0\n" + + "\x14RemoveMemberResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"^\n" + + "\x0fMuteChatRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" + + "\achat_id\x18\x02 \x01(\tR\x06chatId\x12\x19\n" + + "\bis_muted\x18\x03 \x01(\bR\aisMuted\",\n" + + "\x10MuteChatResponse\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\"\x80\x01\n" + "\x12GetMessagesRequest\x12\x17\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" + @@ -1078,7 +1561,13 @@ const file_chat_chat_proto_rawDesc = "" + "\tsender_id\x18\x02 \x01(\tR\bsenderId\x12\x12\n" + "\x04type\x18\x03 \x01(\tR\x04type\x12\x18\n" + "\acontent\x18\x04 \x01(\tR\acontent\x12\x1e\n" + - "\vreply_to_id\x18\x05 \x01(\tR\treplyToId\"q\n" + + "\vreply_to_id\x18\x05 \x01(\tR\treplyToId\"m\n" + + "\x12EditMessageRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "message_id\x18\x02 \x01(\tR\tmessageId\x12\x1f\n" + + "\vnew_content\x18\x03 \x01(\tR\n" + + "newContent\"q\n" + "\x14DeleteMessageRequest\x12\x17\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + "\n" + @@ -1092,15 +1581,19 @@ const file_chat_chat_proto_rawDesc = "" + "\n" + "message_id\x18\x03 \x01(\tR\tmessageId\".\n" + "\x12MarkAsReadResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess2\xc8\x04\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess2\xea\x06\n" + "\vChatService\x12E\n" + "\n" + "CreateChat\x12\x1a.chat.v1.CreateChatRequest\x1a\x1b.chat.v1.CreateChatResponse\x12K\n" + - "\fGetUserChats\x12\x1c.chat.v1.GetUserChatsRequest\x1a\x1d.chat.v1.GetUserChatsResponse\x12?\n" + + "\fGetUserChats\x12\x1c.chat.v1.GetUserChatsRequest\x1a\x1d.chat.v1.GetUserChatsResponse\x12Q\n" + + "\x0eGetChatDetails\x12\x1e.chat.v1.GetChatDetailsRequest\x1a\x1f.chat.v1.GetChatDetailsResponse\x12?\n" + "\bJoinChat\x12\x18.chat.v1.JoinChatRequest\x1a\x19.chat.v1.JoinChatResponse\x12B\n" + - "\tLeaveChat\x12\x19.chat.v1.LeaveChatRequest\x1a\x1a.chat.v1.LeaveChatResponse\x12H\n" + + "\tLeaveChat\x12\x19.chat.v1.LeaveChatRequest\x1a\x1a.chat.v1.LeaveChatResponse\x12K\n" + + "\fRemoveMember\x12\x1c.chat.v1.RemoveMemberRequest\x1a\x1d.chat.v1.RemoveMemberResponse\x12?\n" + + "\bMuteChat\x12\x18.chat.v1.MuteChatRequest\x1a\x19.chat.v1.MuteChatResponse\x12H\n" + "\vGetMessages\x12\x1b.chat.v1.GetMessagesRequest\x1a\x1c.chat.v1.GetMessagesResponse\x12?\n" + - "\vSendMessage\x12\x1b.chat.v1.SendMessageRequest\x1a\x13.chat.v1.MessageDto\x12N\n" + + "\vSendMessage\x12\x1b.chat.v1.SendMessageRequest\x1a\x13.chat.v1.MessageDto\x12?\n" + + "\vEditMessage\x12\x1b.chat.v1.EditMessageRequest\x1a\x13.chat.v1.MessageDto\x12N\n" + "\rDeleteMessage\x12\x1d.chat.v1.DeleteMessageRequest\x1a\x1e.chat.v1.DeleteMessageResponse\x12E\n" + "\n" + "MarkAsRead\x12\x1a.chat.v1.MarkAsReadRequest\x1a\x1b.chat.v1.MarkAsReadResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" @@ -1117,52 +1610,70 @@ func file_chat_chat_proto_rawDescGZIP() []byte { return file_chat_chat_proto_rawDescData } -var file_chat_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_chat_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_chat_chat_proto_goTypes = []any{ - (*MessageDto)(nil), // 0: chat.v1.MessageDto - (*ChatDto)(nil), // 1: chat.v1.ChatDto - (*CreateChatRequest)(nil), // 2: chat.v1.CreateChatRequest - (*CreateChatResponse)(nil), // 3: chat.v1.CreateChatResponse - (*GetUserChatsRequest)(nil), // 4: chat.v1.GetUserChatsRequest - (*GetUserChatsResponse)(nil), // 5: chat.v1.GetUserChatsResponse - (*JoinChatRequest)(nil), // 6: chat.v1.JoinChatRequest - (*JoinChatResponse)(nil), // 7: chat.v1.JoinChatResponse - (*LeaveChatRequest)(nil), // 8: chat.v1.LeaveChatRequest - (*LeaveChatResponse)(nil), // 9: chat.v1.LeaveChatResponse - (*GetMessagesRequest)(nil), // 10: chat.v1.GetMessagesRequest - (*GetMessagesResponse)(nil), // 11: chat.v1.GetMessagesResponse - (*SendMessageRequest)(nil), // 12: chat.v1.SendMessageRequest - (*DeleteMessageRequest)(nil), // 13: chat.v1.DeleteMessageRequest - (*DeleteMessageResponse)(nil), // 14: chat.v1.DeleteMessageResponse - (*MarkAsReadRequest)(nil), // 15: chat.v1.MarkAsReadRequest - (*MarkAsReadResponse)(nil), // 16: chat.v1.MarkAsReadResponse + (*MessageDto)(nil), // 0: chat.v1.MessageDto + (*ChatMemberDto)(nil), // 1: chat.v1.ChatMemberDto + (*ChatDto)(nil), // 2: chat.v1.ChatDto + (*CreateChatRequest)(nil), // 3: chat.v1.CreateChatRequest + (*CreateChatResponse)(nil), // 4: chat.v1.CreateChatResponse + (*GetUserChatsRequest)(nil), // 5: chat.v1.GetUserChatsRequest + (*GetUserChatsResponse)(nil), // 6: chat.v1.GetUserChatsResponse + (*GetChatDetailsRequest)(nil), // 7: chat.v1.GetChatDetailsRequest + (*GetChatDetailsResponse)(nil), // 8: chat.v1.GetChatDetailsResponse + (*JoinChatRequest)(nil), // 9: chat.v1.JoinChatRequest + (*JoinChatResponse)(nil), // 10: chat.v1.JoinChatResponse + (*LeaveChatRequest)(nil), // 11: chat.v1.LeaveChatRequest + (*LeaveChatResponse)(nil), // 12: chat.v1.LeaveChatResponse + (*RemoveMemberRequest)(nil), // 13: chat.v1.RemoveMemberRequest + (*RemoveMemberResponse)(nil), // 14: chat.v1.RemoveMemberResponse + (*MuteChatRequest)(nil), // 15: chat.v1.MuteChatRequest + (*MuteChatResponse)(nil), // 16: chat.v1.MuteChatResponse + (*GetMessagesRequest)(nil), // 17: chat.v1.GetMessagesRequest + (*GetMessagesResponse)(nil), // 18: chat.v1.GetMessagesResponse + (*SendMessageRequest)(nil), // 19: chat.v1.SendMessageRequest + (*EditMessageRequest)(nil), // 20: chat.v1.EditMessageRequest + (*DeleteMessageRequest)(nil), // 21: chat.v1.DeleteMessageRequest + (*DeleteMessageResponse)(nil), // 22: chat.v1.DeleteMessageResponse + (*MarkAsReadRequest)(nil), // 23: chat.v1.MarkAsReadRequest + (*MarkAsReadResponse)(nil), // 24: chat.v1.MarkAsReadResponse } var file_chat_chat_proto_depIdxs = []int32{ 0, // 0: chat.v1.ChatDto.last_message:type_name -> chat.v1.MessageDto - 1, // 1: chat.v1.CreateChatResponse.chat:type_name -> chat.v1.ChatDto - 1, // 2: chat.v1.GetUserChatsResponse.chats:type_name -> chat.v1.ChatDto - 0, // 3: chat.v1.GetMessagesResponse.messages:type_name -> chat.v1.MessageDto - 2, // 4: chat.v1.ChatService.CreateChat:input_type -> chat.v1.CreateChatRequest - 4, // 5: chat.v1.ChatService.GetUserChats:input_type -> chat.v1.GetUserChatsRequest - 6, // 6: chat.v1.ChatService.JoinChat:input_type -> chat.v1.JoinChatRequest - 8, // 7: chat.v1.ChatService.LeaveChat:input_type -> chat.v1.LeaveChatRequest - 10, // 8: chat.v1.ChatService.GetMessages:input_type -> chat.v1.GetMessagesRequest - 12, // 9: chat.v1.ChatService.SendMessage:input_type -> chat.v1.SendMessageRequest - 13, // 10: chat.v1.ChatService.DeleteMessage:input_type -> chat.v1.DeleteMessageRequest - 15, // 11: chat.v1.ChatService.MarkAsRead:input_type -> chat.v1.MarkAsReadRequest - 3, // 12: chat.v1.ChatService.CreateChat:output_type -> chat.v1.CreateChatResponse - 5, // 13: chat.v1.ChatService.GetUserChats:output_type -> chat.v1.GetUserChatsResponse - 7, // 14: chat.v1.ChatService.JoinChat:output_type -> chat.v1.JoinChatResponse - 9, // 15: chat.v1.ChatService.LeaveChat:output_type -> chat.v1.LeaveChatResponse - 11, // 16: chat.v1.ChatService.GetMessages:output_type -> chat.v1.GetMessagesResponse - 0, // 17: chat.v1.ChatService.SendMessage:output_type -> chat.v1.MessageDto - 14, // 18: chat.v1.ChatService.DeleteMessage:output_type -> chat.v1.DeleteMessageResponse - 16, // 19: chat.v1.ChatService.MarkAsRead:output_type -> chat.v1.MarkAsReadResponse - 12, // [12:20] is the sub-list for method output_type - 4, // [4:12] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 2, // 1: chat.v1.CreateChatResponse.chat:type_name -> chat.v1.ChatDto + 2, // 2: chat.v1.GetUserChatsResponse.chats:type_name -> chat.v1.ChatDto + 2, // 3: chat.v1.GetChatDetailsResponse.chat:type_name -> chat.v1.ChatDto + 1, // 4: chat.v1.GetChatDetailsResponse.members:type_name -> chat.v1.ChatMemberDto + 0, // 5: chat.v1.GetMessagesResponse.messages:type_name -> chat.v1.MessageDto + 3, // 6: chat.v1.ChatService.CreateChat:input_type -> chat.v1.CreateChatRequest + 5, // 7: chat.v1.ChatService.GetUserChats:input_type -> chat.v1.GetUserChatsRequest + 7, // 8: chat.v1.ChatService.GetChatDetails:input_type -> chat.v1.GetChatDetailsRequest + 9, // 9: chat.v1.ChatService.JoinChat:input_type -> chat.v1.JoinChatRequest + 11, // 10: chat.v1.ChatService.LeaveChat:input_type -> chat.v1.LeaveChatRequest + 13, // 11: chat.v1.ChatService.RemoveMember:input_type -> chat.v1.RemoveMemberRequest + 15, // 12: chat.v1.ChatService.MuteChat:input_type -> chat.v1.MuteChatRequest + 17, // 13: chat.v1.ChatService.GetMessages:input_type -> chat.v1.GetMessagesRequest + 19, // 14: chat.v1.ChatService.SendMessage:input_type -> chat.v1.SendMessageRequest + 20, // 15: chat.v1.ChatService.EditMessage:input_type -> chat.v1.EditMessageRequest + 21, // 16: chat.v1.ChatService.DeleteMessage:input_type -> chat.v1.DeleteMessageRequest + 23, // 17: chat.v1.ChatService.MarkAsRead:input_type -> chat.v1.MarkAsReadRequest + 4, // 18: chat.v1.ChatService.CreateChat:output_type -> chat.v1.CreateChatResponse + 6, // 19: chat.v1.ChatService.GetUserChats:output_type -> chat.v1.GetUserChatsResponse + 8, // 20: chat.v1.ChatService.GetChatDetails:output_type -> chat.v1.GetChatDetailsResponse + 10, // 21: chat.v1.ChatService.JoinChat:output_type -> chat.v1.JoinChatResponse + 12, // 22: chat.v1.ChatService.LeaveChat:output_type -> chat.v1.LeaveChatResponse + 14, // 23: chat.v1.ChatService.RemoveMember:output_type -> chat.v1.RemoveMemberResponse + 16, // 24: chat.v1.ChatService.MuteChat:output_type -> chat.v1.MuteChatResponse + 18, // 25: chat.v1.ChatService.GetMessages:output_type -> chat.v1.GetMessagesResponse + 0, // 26: chat.v1.ChatService.SendMessage:output_type -> chat.v1.MessageDto + 0, // 27: chat.v1.ChatService.EditMessage:output_type -> chat.v1.MessageDto + 22, // 28: chat.v1.ChatService.DeleteMessage:output_type -> chat.v1.DeleteMessageResponse + 24, // 29: chat.v1.ChatService.MarkAsRead:output_type -> chat.v1.MarkAsReadResponse + 18, // [18:30] is the sub-list for method output_type + 6, // [6:18] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_chat_chat_proto_init() } @@ -1176,7 +1687,7 @@ func file_chat_chat_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_chat_chat_proto_rawDesc), len(file_chat_chat_proto_rawDesc)), NumEnums: 0, - NumMessages: 17, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/chat/chat_grpc.pb.go b/gen/go/chat/chat_grpc.pb.go index 48e6c07..6fd885d 100644 --- a/gen/go/chat/chat_grpc.pb.go +++ b/gen/go/chat/chat_grpc.pb.go @@ -19,28 +19,37 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - ChatService_CreateChat_FullMethodName = "/chat.v1.ChatService/CreateChat" - ChatService_GetUserChats_FullMethodName = "/chat.v1.ChatService/GetUserChats" - ChatService_JoinChat_FullMethodName = "/chat.v1.ChatService/JoinChat" - ChatService_LeaveChat_FullMethodName = "/chat.v1.ChatService/LeaveChat" - ChatService_GetMessages_FullMethodName = "/chat.v1.ChatService/GetMessages" - ChatService_SendMessage_FullMethodName = "/chat.v1.ChatService/SendMessage" - ChatService_DeleteMessage_FullMethodName = "/chat.v1.ChatService/DeleteMessage" - ChatService_MarkAsRead_FullMethodName = "/chat.v1.ChatService/MarkAsRead" + ChatService_CreateChat_FullMethodName = "/chat.v1.ChatService/CreateChat" + ChatService_GetUserChats_FullMethodName = "/chat.v1.ChatService/GetUserChats" + ChatService_GetChatDetails_FullMethodName = "/chat.v1.ChatService/GetChatDetails" + ChatService_JoinChat_FullMethodName = "/chat.v1.ChatService/JoinChat" + ChatService_LeaveChat_FullMethodName = "/chat.v1.ChatService/LeaveChat" + ChatService_RemoveMember_FullMethodName = "/chat.v1.ChatService/RemoveMember" + ChatService_MuteChat_FullMethodName = "/chat.v1.ChatService/MuteChat" + ChatService_GetMessages_FullMethodName = "/chat.v1.ChatService/GetMessages" + ChatService_SendMessage_FullMethodName = "/chat.v1.ChatService/SendMessage" + ChatService_EditMessage_FullMethodName = "/chat.v1.ChatService/EditMessage" + ChatService_DeleteMessage_FullMethodName = "/chat.v1.ChatService/DeleteMessage" + ChatService_MarkAsRead_FullMethodName = "/chat.v1.ChatService/MarkAsRead" ) // ChatServiceClient is the client API for ChatService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ChatServiceClient interface { - // Управление чатами + // Управление чатами (левая панель) CreateChat(ctx context.Context, in *CreateChatRequest, opts ...grpc.CallOption) (*CreateChatResponse, error) GetUserChats(ctx context.Context, in *GetUserChatsRequest, opts ...grpc.CallOption) (*GetUserChatsResponse, error) + GetChatDetails(ctx context.Context, in *GetChatDetailsRequest, opts ...grpc.CallOption) (*GetChatDetailsResponse, error) + // Управление участниками группы JoinChat(ctx context.Context, in *JoinChatRequest, opts ...grpc.CallOption) (*JoinChatResponse, error) LeaveChat(ctx context.Context, in *LeaveChatRequest, opts ...grpc.CallOption) (*LeaveChatResponse, error) - // Управление сообщениями (история) + RemoveMember(ctx context.Context, in *RemoveMemberRequest, opts ...grpc.CallOption) (*RemoveMemberResponse, error) + MuteChat(ctx context.Context, in *MuteChatRequest, opts ...grpc.CallOption) (*MuteChatResponse, error) + // Управление сообщениями (правое окно) GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*MessageDto, error) + EditMessage(ctx context.Context, in *EditMessageRequest, opts ...grpc.CallOption) (*MessageDto, error) DeleteMessage(ctx context.Context, in *DeleteMessageRequest, opts ...grpc.CallOption) (*DeleteMessageResponse, error) // Статусы MarkAsRead(ctx context.Context, in *MarkAsReadRequest, opts ...grpc.CallOption) (*MarkAsReadResponse, error) @@ -74,6 +83,16 @@ func (c *chatServiceClient) GetUserChats(ctx context.Context, in *GetUserChatsRe return out, nil } +func (c *chatServiceClient) GetChatDetails(ctx context.Context, in *GetChatDetailsRequest, opts ...grpc.CallOption) (*GetChatDetailsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetChatDetailsResponse) + err := c.cc.Invoke(ctx, ChatService_GetChatDetails_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *chatServiceClient) JoinChat(ctx context.Context, in *JoinChatRequest, opts ...grpc.CallOption) (*JoinChatResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(JoinChatResponse) @@ -94,6 +113,26 @@ func (c *chatServiceClient) LeaveChat(ctx context.Context, in *LeaveChatRequest, return out, nil } +func (c *chatServiceClient) RemoveMember(ctx context.Context, in *RemoveMemberRequest, opts ...grpc.CallOption) (*RemoveMemberResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RemoveMemberResponse) + err := c.cc.Invoke(ctx, ChatService_RemoveMember_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatServiceClient) MuteChat(ctx context.Context, in *MuteChatRequest, opts ...grpc.CallOption) (*MuteChatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MuteChatResponse) + err := c.cc.Invoke(ctx, ChatService_MuteChat_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *chatServiceClient) GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetMessagesResponse) @@ -114,6 +153,16 @@ func (c *chatServiceClient) SendMessage(ctx context.Context, in *SendMessageRequ return out, nil } +func (c *chatServiceClient) EditMessage(ctx context.Context, in *EditMessageRequest, opts ...grpc.CallOption) (*MessageDto, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MessageDto) + err := c.cc.Invoke(ctx, ChatService_EditMessage_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *chatServiceClient) DeleteMessage(ctx context.Context, in *DeleteMessageRequest, opts ...grpc.CallOption) (*DeleteMessageResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DeleteMessageResponse) @@ -138,14 +187,19 @@ func (c *chatServiceClient) MarkAsRead(ctx context.Context, in *MarkAsReadReques // All implementations must embed UnimplementedChatServiceServer // for forward compatibility. type ChatServiceServer interface { - // Управление чатами + // Управление чатами (левая панель) CreateChat(context.Context, *CreateChatRequest) (*CreateChatResponse, error) GetUserChats(context.Context, *GetUserChatsRequest) (*GetUserChatsResponse, error) + GetChatDetails(context.Context, *GetChatDetailsRequest) (*GetChatDetailsResponse, error) + // Управление участниками группы JoinChat(context.Context, *JoinChatRequest) (*JoinChatResponse, error) LeaveChat(context.Context, *LeaveChatRequest) (*LeaveChatResponse, error) - // Управление сообщениями (история) + RemoveMember(context.Context, *RemoveMemberRequest) (*RemoveMemberResponse, error) + MuteChat(context.Context, *MuteChatRequest) (*MuteChatResponse, error) + // Управление сообщениями (правое окно) GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error) SendMessage(context.Context, *SendMessageRequest) (*MessageDto, error) + EditMessage(context.Context, *EditMessageRequest) (*MessageDto, error) DeleteMessage(context.Context, *DeleteMessageRequest) (*DeleteMessageResponse, error) // Статусы MarkAsRead(context.Context, *MarkAsReadRequest) (*MarkAsReadResponse, error) @@ -165,18 +219,30 @@ func (UnimplementedChatServiceServer) CreateChat(context.Context, *CreateChatReq func (UnimplementedChatServiceServer) GetUserChats(context.Context, *GetUserChatsRequest) (*GetUserChatsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetUserChats not implemented") } +func (UnimplementedChatServiceServer) GetChatDetails(context.Context, *GetChatDetailsRequest) (*GetChatDetailsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetChatDetails not implemented") +} func (UnimplementedChatServiceServer) JoinChat(context.Context, *JoinChatRequest) (*JoinChatResponse, error) { return nil, status.Error(codes.Unimplemented, "method JoinChat not implemented") } func (UnimplementedChatServiceServer) LeaveChat(context.Context, *LeaveChatRequest) (*LeaveChatResponse, error) { return nil, status.Error(codes.Unimplemented, "method LeaveChat not implemented") } +func (UnimplementedChatServiceServer) RemoveMember(context.Context, *RemoveMemberRequest) (*RemoveMemberResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RemoveMember not implemented") +} +func (UnimplementedChatServiceServer) MuteChat(context.Context, *MuteChatRequest) (*MuteChatResponse, error) { + return nil, status.Error(codes.Unimplemented, "method MuteChat not implemented") +} func (UnimplementedChatServiceServer) GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetMessages not implemented") } func (UnimplementedChatServiceServer) SendMessage(context.Context, *SendMessageRequest) (*MessageDto, error) { return nil, status.Error(codes.Unimplemented, "method SendMessage not implemented") } +func (UnimplementedChatServiceServer) EditMessage(context.Context, *EditMessageRequest) (*MessageDto, error) { + return nil, status.Error(codes.Unimplemented, "method EditMessage not implemented") +} func (UnimplementedChatServiceServer) DeleteMessage(context.Context, *DeleteMessageRequest) (*DeleteMessageResponse, error) { return nil, status.Error(codes.Unimplemented, "method DeleteMessage not implemented") } @@ -240,6 +306,24 @@ func _ChatService_GetUserChats_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ChatService_GetChatDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetChatDetailsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).GetChatDetails(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_GetChatDetails_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).GetChatDetails(ctx, req.(*GetChatDetailsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _ChatService_JoinChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(JoinChatRequest) if err := dec(in); err != nil { @@ -276,6 +360,42 @@ func _ChatService_LeaveChat_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _ChatService_RemoveMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveMemberRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).RemoveMember(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_RemoveMember_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).RemoveMember(ctx, req.(*RemoveMemberRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChatService_MuteChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MuteChatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).MuteChat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_MuteChat_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).MuteChat(ctx, req.(*MuteChatRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _ChatService_GetMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetMessagesRequest) if err := dec(in); err != nil { @@ -312,6 +432,24 @@ func _ChatService_SendMessage_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ChatService_EditMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EditMessageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServiceServer).EditMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ChatService_EditMessage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServiceServer).EditMessage(ctx, req.(*EditMessageRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _ChatService_DeleteMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteMessageRequest) if err := dec(in); err != nil { @@ -363,6 +501,10 @@ var ChatService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetUserChats", Handler: _ChatService_GetUserChats_Handler, }, + { + MethodName: "GetChatDetails", + Handler: _ChatService_GetChatDetails_Handler, + }, { MethodName: "JoinChat", Handler: _ChatService_JoinChat_Handler, @@ -371,6 +513,14 @@ var ChatService_ServiceDesc = grpc.ServiceDesc{ MethodName: "LeaveChat", Handler: _ChatService_LeaveChat_Handler, }, + { + MethodName: "RemoveMember", + Handler: _ChatService_RemoveMember_Handler, + }, + { + MethodName: "MuteChat", + Handler: _ChatService_MuteChat_Handler, + }, { MethodName: "GetMessages", Handler: _ChatService_GetMessages_Handler, @@ -379,6 +529,10 @@ var ChatService_ServiceDesc = grpc.ServiceDesc{ MethodName: "SendMessage", Handler: _ChatService_SendMessage_Handler, }, + { + MethodName: "EditMessage", + Handler: _ChatService_EditMessage_Handler, + }, { MethodName: "DeleteMessage", Handler: _ChatService_DeleteMessage_Handler,