Files
open-im-server/pkg/proto/group/group.proto
T

360 lines
8.0 KiB
Protocol Buffer
Raw Normal View History

2021-05-26 20:06:02 +08:00
syntax = "proto3";
2022-09-20 23:31:28 +08:00
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto";
2022-09-21 08:36:33 +08:00
option go_package = "Open_IM/pkg/proto/group;group";
2021-05-26 20:06:02 +08:00
package group;
2021-12-23 17:22:49 +08:00
message GroupAddMemberInfo{
2023-01-05 17:09:35 +08:00
string userID = 1;
int32 roleLevel = 2;
2021-06-28 15:33:26 +08:00
}
2021-12-21 21:40:50 +08:00
2021-12-23 17:22:49 +08:00
message CreateGroupReq{
2023-01-05 17:09:35 +08:00
repeated GroupAddMemberInfo initMemberList = 1;
server_api_params.GroupInfo groupInfo = 2;
string ownerUserID = 5; //owner
2021-05-26 20:06:02 +08:00
}
message CreateGroupResp{
2023-01-05 17:09:35 +08:00
server_api_params.GroupInfo groupInfo = 3;
2021-05-26 20:06:02 +08:00
}
2021-12-26 18:47:11 +08:00
2021-06-28 15:33:26 +08:00
message GetGroupsInfoReq{
2023-01-05 17:09:35 +08:00
repeated string groupIDList = 1;
2021-05-26 20:06:02 +08:00
}
2021-06-28 15:33:26 +08:00
message GetGroupsInfoResp{
2023-01-05 17:09:35 +08:00
repeated server_api_params.GroupInfo groupInfoList = 3;
2021-05-26 20:06:02 +08:00
}
2021-12-23 17:22:49 +08:00
2021-06-28 15:33:26 +08:00
message SetGroupInfoReq{
2022-06-28 20:39:27 +08:00
server_api_params.GroupInfoForSet groupInfoForSet = 1;
2021-06-28 15:33:26 +08:00
}
2021-12-26 18:47:11 +08:00
message SetGroupInfoResp{
}
2021-06-28 15:33:26 +08:00
2021-12-23 18:29:39 +08:00
2021-06-28 15:33:26 +08:00
message GetGroupApplicationListReq {
2023-01-13 16:56:46 +08:00
server_api_params.RequestPagination pagination = 1;
string fromUserID = 3; //owner or admin
2021-05-26 20:06:02 +08:00
}
2021-06-28 15:33:26 +08:00
message GetGroupApplicationListResp {
2023-01-13 16:56:46 +08:00
int32 total = 1;
2023-01-05 17:09:35 +08:00
repeated server_api_params.GroupRequest groupRequestList = 3;
2021-06-28 15:33:26 +08:00
}
2021-05-26 20:06:02 +08:00
2022-02-09 19:20:46 +08:00
message GetUserReqApplicationListReq{
2023-01-05 17:09:35 +08:00
string userID = 1;
2023-01-13 16:59:40 +08:00
server_api_params.RequestPagination pagination = 2;
2022-02-09 19:20:46 +08:00
}
message GetUserReqApplicationListResp{
2023-01-13 16:56:46 +08:00
int32 total = 1;
2023-01-05 17:09:35 +08:00
repeated server_api_params.GroupRequest groupRequestList = 2;
2022-02-09 19:20:46 +08:00
}
2021-12-26 18:47:11 +08:00
2021-06-28 15:33:26 +08:00
message TransferGroupOwnerReq {
2023-01-05 17:09:35 +08:00
string groupID = 1;
string oldOwnerUserID = 2;
string newOwnerUserID = 3;
2021-05-26 20:06:02 +08:00
}
2021-12-26 18:47:11 +08:00
message TransferGroupOwnerResp{
2023-01-12 19:55:51 +08:00
2021-12-26 18:47:11 +08:00
}
2021-05-26 20:06:02 +08:00
2021-06-28 15:33:26 +08:00
message JoinGroupReq{
2023-01-05 17:09:35 +08:00
string groupID = 1;
string reqMessage = 2;
int32 joinSource = 5;
string inviterUserID = 6;
2021-05-26 20:06:02 +08:00
}
2021-12-26 18:47:11 +08:00
message JoinGroupResp{
}
2021-05-26 20:06:02 +08:00
2021-06-28 15:33:26 +08:00
message GroupApplicationResponseReq{
2023-01-05 17:09:35 +08:00
string groupID = 3;
string fromUserID = 4; //
string handledMsg = 5;
int32 handleResult = 6;
2021-06-28 15:33:26 +08:00
}
2021-12-26 18:47:11 +08:00
message GroupApplicationResponseResp{
2023-01-12 19:55:51 +08:00
2021-05-26 20:06:02 +08:00
}
2021-12-26 18:47:11 +08:00
2021-06-28 15:33:26 +08:00
message QuitGroupReq{
2023-01-05 17:09:35 +08:00
string groupID = 1;
2021-05-26 20:06:02 +08:00
}
2021-12-26 18:47:11 +08:00
message QuitGroupResp{
}
2021-05-26 20:06:02 +08:00
2021-06-28 15:33:26 +08:00
message GetGroupMemberListReq {
2023-01-05 17:09:35 +08:00
string groupID = 1;
int32 filter = 4;
2023-01-13 16:59:40 +08:00
server_api_params.RequestPagination pagination = 2;
2021-06-28 15:33:26 +08:00
}
message GetGroupMemberListResp {
2023-01-13 16:56:46 +08:00
int32 total = 1;
2022-01-15 15:25:12 +08:00
repeated server_api_params.GroupMemberFullInfo memberList = 3;
2021-06-28 15:33:26 +08:00
}
message GetGroupMembersInfoReq {
2023-01-05 17:09:35 +08:00
string groupID = 1;
2021-09-06 17:48:14 +08:00
repeated string memberList = 2;
2021-05-26 20:06:02 +08:00
}
2021-06-28 15:33:26 +08:00
message GetGroupMembersInfoResp {
2022-01-15 15:25:12 +08:00
repeated server_api_params.GroupMemberFullInfo memberList = 3;
2021-06-28 15:33:26 +08:00
}
2021-05-26 20:06:02 +08:00
2021-06-28 15:33:26 +08:00
message KickGroupMemberReq {
2023-01-05 17:09:35 +08:00
string groupID = 1;
repeated string kickedUserIDList = 2;
string reason = 3;
2021-06-28 15:33:26 +08:00
}
message Id2Result {
2023-01-05 17:09:35 +08:00
string userID = 1;
int32 result = 2; //0 ok; -1 error
2021-05-26 20:06:02 +08:00
}
2021-06-28 15:33:26 +08:00
message KickGroupMemberResp {
2023-01-05 17:09:35 +08:00
repeated Id2Result id2ResultList = 3;
2021-06-28 15:33:26 +08:00
}
2021-05-26 20:06:02 +08:00
2021-12-23 17:22:49 +08:00
message GetJoinedGroupListReq {
2023-01-05 17:09:35 +08:00
string fromUserID = 1;
2023-01-13 16:56:46 +08:00
server_api_params.RequestPagination pagination = 2;
2021-06-28 15:33:26 +08:00
}
2021-12-23 17:22:49 +08:00
message GetJoinedGroupListResp{
2023-01-13 16:56:46 +08:00
int32 total = 1;
2023-01-05 17:09:35 +08:00
repeated server_api_params.GroupInfo groupList = 3;
2021-06-28 15:33:26 +08:00
}
2021-12-23 17:22:49 +08:00
message InviteUserToGroupReq {
2023-01-05 17:09:35 +08:00
string groupID = 3;
string reason = 4;
repeated string invitedUserIDList = 5;
2021-06-28 15:33:26 +08:00
}
2021-12-23 17:22:49 +08:00
message InviteUserToGroupResp {
2023-01-05 17:09:35 +08:00
repeated Id2Result id2ResultList = 3; // 0 ok, -1 error
2021-06-28 15:33:26 +08:00
}
2021-12-23 17:22:49 +08:00
2021-06-28 15:33:26 +08:00
message GetGroupAllMemberReq {
2023-01-05 17:09:35 +08:00
string groupID = 1;
int32 offset = 4;
int32 count = 5;
2021-06-28 15:33:26 +08:00
}
message GetGroupAllMemberResp {
2022-01-15 15:25:12 +08:00
repeated server_api_params.GroupMemberFullInfo memberList = 3;
2021-06-28 15:33:26 +08:00
}
2022-02-07 19:42:09 +08:00
message CMSGroup {
2023-01-05 17:09:35 +08:00
server_api_params.GroupInfo groupInfo = 1;
string groupOwnerUserName = 2;
string groupOwnerUserID = 3;
2022-02-07 19:42:09 +08:00
}
2022-01-25 19:18:04 +08:00
message GetGroupsReq {
2023-01-13 16:56:46 +08:00
server_api_params.RequestPagination pagination = 1;
string groupName = 2;
string groupID = 3;
2022-01-25 19:18:04 +08:00
}
message GetGroupsResp {
2023-01-05 17:09:35 +08:00
repeated CMSGroup groups = 1;
2022-01-27 01:08:02 +08:00
int32 GroupNum = 3;
2022-01-25 19:18:04 +08:00
}
message GetGroupMemberReq {
2023-01-05 17:09:35 +08:00
string groupID = 1;
2022-01-25 19:18:04 +08:00
}
2021-06-28 15:33:26 +08:00
2022-02-07 19:42:09 +08:00
message GetGroupMembersCMSReq {
2023-01-05 17:09:35 +08:00
string groupID = 1;
string userName = 2;
server_api_params.RequestPagination pagination = 3;
2022-02-07 19:42:09 +08:00
}
message GetGroupMembersCMSResp {
2022-02-08 20:24:59 +08:00
repeated server_api_params.GroupMemberFullInfo members = 1;
2023-01-05 17:09:35 +08:00
server_api_params.ResponsePagination pagination = 2;
int32 memberNums = 3;
2022-01-27 18:31:31 +08:00
}
2022-03-24 15:33:30 +08:00
message DismissGroupReq{
string groupID = 3;
}
message DismissGroupResp{
}
2022-02-08 20:24:59 +08:00
2022-03-28 19:27:05 +08:00
message MuteGroupMemberReq{
string groupID = 3;
string userID = 4;
uint32 mutedSeconds = 5;
}
message MuteGroupMemberResp{
}
message CancelMuteGroupMemberReq{
string groupID = 3;
string userID = 4;
}
message CancelMuteGroupMemberResp{
}
message MuteGroupReq{
string groupID = 3;
}
message MuteGroupResp{
}
message CancelMuteGroupReq{
string groupID = 3;
}
message CancelMuteGroupResp{
}
2022-04-18 11:52:17 +08:00
message SetGroupMemberNicknameReq{
string groupID = 1;
string nickname = 2;
string userID = 5;
}
message SetGroupMemberNicknameResp{
}
2022-05-30 11:55:27 +08:00
message GetJoinedSuperGroupListReq {
2023-01-13 16:56:46 +08:00
server_api_params.RequestPagination pagination = 1;
2022-05-30 11:55:27 +08:00
string userID = 2;
}
2022-04-18 11:52:17 +08:00
2022-05-30 11:55:27 +08:00
message GetJoinedSuperGroupListResp {
2023-01-13 16:56:46 +08:00
int32 total = 1;
2023-01-05 17:09:35 +08:00
repeated server_api_params.GroupInfo groupList = 3;
2022-05-30 11:55:27 +08:00
}
2022-04-18 11:52:17 +08:00
2022-05-30 16:23:15 +08:00
message GetSuperGroupsInfoReq {
2023-01-05 17:09:35 +08:00
repeated string groupIDList = 1;
2022-05-30 16:23:15 +08:00
}
message GetSuperGroupsInfoResp {
2023-01-05 17:09:35 +08:00
repeated server_api_params.GroupInfo groupInfoList = 3;
2022-05-30 16:23:15 +08:00
}
2022-03-28 19:27:05 +08:00
2022-06-02 18:17:11 +08:00
message SetGroupMemberInfoReq{
string groupID = 1;
string userID = 2;
2022-06-07 16:18:18 +08:00
google.protobuf.StringValue nickname = 5;
google.protobuf.StringValue faceURL = 6;
google.protobuf.Int32Value roleLevel = 7;
google.protobuf.StringValue ex = 8;
2022-06-02 18:17:11 +08:00
}
2022-04-18 11:52:17 +08:00
2022-06-02 18:17:11 +08:00
message SetGroupMemberInfoResp{
2023-01-12 19:55:51 +08:00
2022-06-02 18:17:11 +08:00
}
2022-03-28 19:27:05 +08:00
2022-08-05 13:40:20 +08:00
message GetGroupAbstractInfoReq{
2023-01-13 16:56:46 +08:00
repeated string groupIDs = 1;
2022-08-05 13:40:20 +08:00
}
2023-01-13 16:56:46 +08:00
message GroupAbstractInfo{
string groupID = 1;
2022-08-05 13:40:20 +08:00
int32 groupMemberNumber = 2;
uint64 groupMemberListHash = 3;
}
2023-01-13 16:56:46 +08:00
message GetGroupAbstractInfoResp{
repeated GroupAbstractInfo groupAbstractInfos = 1;
}
2022-08-05 13:40:20 +08:00
2021-06-28 15:33:26 +08:00
service group{
2023-01-13 16:56:46 +08:00
//创建群
2021-09-06 17:48:14 +08:00
rpc createGroup(CreateGroupReq) returns(CreateGroupResp);
2023-01-13 16:56:46 +08:00
//申请加群
2021-12-26 18:47:11 +08:00
rpc joinGroup(JoinGroupReq) returns(JoinGroupResp);
2023-01-13 16:56:46 +08:00
//退出群
2021-12-26 18:47:11 +08:00
rpc quitGroup(QuitGroupReq) returns(QuitGroupResp);
2023-01-13 16:56:46 +08:00
//获取指定群信息
2021-09-06 17:48:14 +08:00
rpc getGroupsInfo(GetGroupsInfoReq) returns(GetGroupsInfoResp);
2023-01-13 16:56:46 +08:00
//设置群信息
2021-12-26 18:47:11 +08:00
rpc setGroupInfo(SetGroupInfoReq) returns(SetGroupInfoResp);
2023-01-13 16:56:46 +08:00
//(以管理员或群主身份)获取群的加群申请
2021-09-06 17:48:14 +08:00
rpc getGroupApplicationList(GetGroupApplicationListReq) returns(GetGroupApplicationListResp);
2023-01-13 16:56:46 +08:00
//获取用户自己的主动加群申请
2022-02-09 19:20:46 +08:00
rpc getUserReqApplicationList(GetUserReqApplicationListReq) returns(GetUserReqApplicationListResp);
2023-01-13 16:56:46 +08:00
//转让群主
2021-12-26 18:47:11 +08:00
rpc transferGroupOwner(TransferGroupOwnerReq) returns(TransferGroupOwnerResp);
2023-01-13 16:56:46 +08:00
//群主或管理员处理进群申请
2021-12-26 18:47:11 +08:00
rpc groupApplicationResponse(GroupApplicationResponseReq) returns(GroupApplicationResponseResp);
2023-01-13 16:56:46 +08:00
//获取某个群的群成员
2021-09-06 17:48:14 +08:00
rpc getGroupMemberList(GetGroupMemberListReq) returns(GetGroupMemberListResp);
2023-01-13 16:56:46 +08:00
//获取某个群的指定群成员
2021-09-06 17:48:14 +08:00
rpc getGroupMembersInfo(GetGroupMembersInfoReq) returns(GetGroupMembersInfoResp);
2023-01-13 16:56:46 +08:00
//踢出群
2021-09-06 17:48:14 +08:00
rpc kickGroupMember(KickGroupMemberReq) returns (KickGroupMemberResp);
2023-01-13 16:56:46 +08:00
//获取某个人已加入群
2021-12-23 17:22:49 +08:00
rpc getJoinedGroupList(GetJoinedGroupListReq) returns (GetJoinedGroupListResp);
2023-01-13 16:56:46 +08:00
//邀请某些人进群
2021-12-23 17:22:49 +08:00
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
2022-01-25 19:18:04 +08:00
rpc GetGroups(GetGroupsReq) returns(GetGroupsResp);
2022-02-07 19:42:09 +08:00
rpc GetGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp);
2022-08-30 01:38:23 +08:00
2023-01-13 16:56:46 +08:00
//解散群
2022-03-24 15:33:30 +08:00
rpc DismissGroup(DismissGroupReq) returns(DismissGroupResp);
2023-01-13 16:56:46 +08:00
//对某个群成员禁言
2022-03-28 19:27:05 +08:00
rpc MuteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp);
2023-01-13 16:56:46 +08:00
//对某个群成员取消禁言
2022-03-28 19:27:05 +08:00
rpc CancelMuteGroupMember(CancelMuteGroupMemberReq) returns(CancelMuteGroupMemberResp);
2023-01-13 16:56:46 +08:00
//对某个群禁言
2022-03-28 19:27:05 +08:00
rpc MuteGroup(MuteGroupReq) returns(MuteGroupResp);
2023-01-13 16:56:46 +08:00
//对某个群取消禁言
2022-03-28 19:27:05 +08:00
rpc CancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp);
2022-04-18 11:52:17 +08:00
2023-01-13 16:56:46 +08:00
//获取某个用户加入的超级群
2022-05-30 11:55:27 +08:00
rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
2023-01-13 16:56:46 +08:00
//获取指定的超级群信息
2022-05-30 16:23:15 +08:00
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
2023-01-13 16:56:46 +08:00
//设置群成员昵称
rpc SetGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp);
//设置群成员信息
2022-06-02 18:17:11 +08:00
rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
2023-01-13 16:56:46 +08:00
//获取群信息hash值
2022-08-05 13:40:20 +08:00
rpc GetGroupAbstractInfo(GetGroupAbstractInfoReq) returns (GetGroupAbstractInfoResp);
2021-06-28 15:33:26 +08:00
}
2021-05-26 20:06:02 +08:00