|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- syntax = "proto3";
- package pb;
- option go_package = "gim/pkg/pb/";
-
- import "common.ext.proto";
- import "connect.ext.proto";
-
- service LogicExt {
- // 注册设备
- rpc RegisterDevice (RegisterDeviceReq) returns (RegisterDeviceResp);
-
- // 发送消息
- rpc SendMessage (SendMessageReq) returns (SendMessageResp);
- // 撤回消息
- rpc RecallMessage (RecallMessageReq) returns (RecallMessageResp);
- // 推送消息到房间
- rpc PushRoom(PushRoomReq)returns(Empty);
-
- // 发送红包
- rpc SendRedPacket (SendRedPacketReq) returns (SendRedPacketResp);
-
- // 添加好友
- rpc AddFriend (AddFriendReq) returns (Empty);
- // 同意添加好友
- rpc AgreeAddFriend (AgreeAddFriendReq) returns (Empty);
- // 删除好友
- rpc DeleteFriend (DeleteFriendReq) returns (Empty);
- // 设置好友信息
- rpc SetFriend (SetFriendReq) returns (SetFriendResp);
- // 获取好友列表
- rpc GetFriends (Empty) returns (GetFriendsResp);
-
- // 创建群组
- rpc CreateGroup (CreateGroupReq) returns (CreateGroupResp);
- // 更新群组
- rpc UpdateGroup (UpdateGroupReq) returns (Empty);
- // 获取群组信息
- rpc GetGroup (GetGroupReq) returns (GetGroupResp);
- // 获取用户加入的所有群组
- rpc GetGroups (Empty) returns (GetGroupsResp);
-
- // 添加群组成员
- rpc AddGroupMembers (AddGroupMembersReq) returns (AddGroupMembersResp);
- // 更新群组成员信息
- rpc UpdateGroupMember (UpdateGroupMemberReq) returns (Empty);
- // 删除群组成员
- rpc DeleteGroupMember (DeleteGroupMemberReq) returns (Empty);
- // 获取群组成员
- rpc GetGroupMembers (GetGroupMembersReq) returns (GetGroupMembersResp);
- // 设置禁言
- rpc SetGroupBannedMembers (SetGroupMemberBannedReq) returns (SetGroupMemberBannedResp);
- // 获取群组禁言成员
- rpc GetGroupBannedMembers (GetGroupBannedMembersReq) returns (GetGroupBannedMembersResp);
- }
-
- message RegisterDeviceReq {
- int32 type = 2; // 设备类型
- string brand = 3; // 厂商
- string model = 4; // 机型
- string system_version = 5; // 系统版本
- string sdk_version = 6; // sdk版本号
- }
- message RegisterDeviceResp {
- int64 device_id = 1; // 设备id
- }
-
- message SendMessageReq {
- ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
- int64 receiver_id = 2; // 用户id或者群组id
- repeated int64 to_user_ids = 3; // 需要@的用户id列表
- MessageType message_type = 4; // 消息类型
- bytes message_content = 5; // 消息内容
- int64 send_time = 6; // 消息发送时间戳,精确到毫秒
- bool is_persist = 7; // 是否将消息持久化到数据库
- string message_content_back = 8;
- }
- message SendMessageResp {
- int64 seq = 1; // 消息序列号
- }
-
- message RecallMessageReq {
- ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
- int64 receiver_id = 2; // 用户id或者群组id
- repeated int64 to_user_ids = 3; // 需要@的用户id列表
- MessageType message_type = 4; // 消息类型
- bytes message_content = 5; // 消息内容
- int64 send_time = 6; // 消息发送时间戳,精确到毫秒
- bool is_persist = 7; // 是否将消息持久化到数据库
- string message_content_back = 8;
- }
- message RecallMessageResp {
- int64 seq = 1; // 消息序列号
- }
-
-
- message SendRedPacketReq {
- ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
- int64 receiver_id = 2; // 用户id或者群组id
- MessageType message_type = 3; // 消息类型
- bytes message_content = 4; // 消息内容
- int64 send_time = 5; // 消息发送时间戳,精确到毫秒
- repeated int64 to_user_ids = 6; // 红包给到哪些用户(专属红包)
- string message_content_back = 7;
- }
- message SendRedPacketResp {
- int64 seq = 1; // 消息序列号
- }
-
- message PushRoomReq{
- int64 room_id = 1; // 房间id
- MessageType message_type = 2; // 消息类型
- bytes message_content = 3; // 消息内容
- int64 send_time = 4; // 消息发送时间戳,精确到毫秒
- bool is_persist = 5; // 是否将消息持久化
- bool is_priority = 6; // 是否优先推送
- }
-
- message AddFriendReq {
- int64 friend_id = 1; // 用户id
- string remarks = 2; // 备注
- string description = 3; // 描述
- }
-
- message DeleteFriendReq {
- int64 user_id = 1; // 用户id
- }
-
-
- message AgreeAddFriendReq {
- int64 user_id = 1; // 用户id
- string remarks = 2; // 备注
- }
-
- message SetFriendReq {
- int64 friend_id = 1; // 好友id
- string remarks = 2; // 备注
- string extra = 8; // 附加字段
- }
- message SetFriendResp {
- int64 friend_id = 1; // 好友id
- string remarks = 2; // 备注
- string extra = 8; // 附加字段
- }
-
- message Friend {
- int64 user_id = 1; // 用户id
- string phone_number = 2; // 电话号码
- string nickname = 3; // 昵称
- int32 sex = 4; // 性别
- string avatar_url = 5; // 头像地址
- string user_extra = 6; // 用户附加字段
- string remarks = 7; // 备注
- string extra = 8; // 附加字段
- }
- message GetFriendsResp {
- repeated Friend friends = 1;
- }
-
- message CreateGroupReq {
- string name = 1; // 名称
- string avatar_url = 2; // 头像
- string introduction = 3; // 简介
- string extra = 4; // 附加字段
- repeated int64 member_ids = 5; // 群组成员ID列表
- }
- message CreateGroupResp {
- int64 group_id = 1; // 群组id
- }
-
- message UpdateGroupReq {
- int64 group_id = 1; // 群组id
- string avatar_url = 2; // 头像
- string name = 3; // 名称
- string introduction = 4; // 简介
- string extra = 5; // 附加字段
- }
-
- message GetGroupReq {
- int64 group_id = 1;
- }
- message GetGroupResp {
- Group group = 1;
- }
-
- message Group {
- int64 group_id = 1; // 群组id
- string name = 2; // 名称
- string avatar_url = 3; // 头像
- string introduction = 4; // 简介
- int32 user_mum = 5; // 用户数
- string extra = 6; // 附加字段
- int64 create_time = 7; // 创建时间
- int64 update_time = 8; // 更新时间
- }
-
- message GetGroupsResp {
- repeated Group groups = 1;
- }
-
- message AddGroupMembersReq {
- int64 group_id = 1; // 群组id
- repeated int64 user_ids = 2; // 用户id列表
- }
- message AddGroupMembersResp {
- repeated int64 user_ids = 1; // 已经在群组的用户id列表
- }
-
- enum MemberType {
- GMT_UNKNOWN = 0; // 未知
- GMT_ADMIN = 1; // 管理员
- GMT_MEMBER = 2; // 成员
- }
-
- message UpdateGroupMemberReq {
- int64 group_id = 1; // 群组id
- int64 user_id = 2; // 用户id
- MemberType member_type = 3; // 成员类型
- string remarks = 4; // 备注
- string extra = 5; // 附加字段
- }
-
- message DeleteGroupMemberReq {
- int64 group_id = 1; // 群组id
- int64 user_id = 2; // 用户id
- }
-
- message GetGroupMembersReq {
- int64 group_id = 1;
- }
- message GetGroupMembersResp {
- repeated GroupMember members = 1;
- }
- message GroupMember {
- int64 user_id = 1;
- string nickname = 2; // 昵称
- int32 sex = 3; // 性别
- string avatar_url = 4; // 头像地址
- string user_extra = 5; // 用户附加字段
- MemberType member_type = 6; // 成员类型
- string remarks = 7; // 备注
- string extra = 8; // 群组成员附加字段
- }
-
- message SetGroupMemberBannedReq {
- int64 group_id = 1; // 群组id
- repeated int64 user_ids = 2; // 用户id列表
- AllMemberBannedType is_all_member_banned = 3; // 全员禁言(1:是 2:否)
- }
-
- enum AllMemberBannedType {
- UNKNOWN_All_Member_Banned = 0; // 未知
- YES_All_Member_Banned = 1; // 是-全员禁言
- NOT_All_Member_Banned = 2; // 否-全员禁言
- }
-
- message SetGroupMemberBannedResp {
- AllMemberBannedType is_all_member_banned = 3; // 全员禁言(1:是 2:否)
- repeated GroupMember members = 1; //禁言人员列表
- }
-
- message GetGroupBannedMembersReq {
- int64 group_id = 1;
- }
- message GetGroupBannedMembersResp {
- repeated GroupMember members = 1;
- }
|