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

176 lines
4.2 KiB
Protocol Buffer
Raw Normal View History

2021-05-26 19:44:38 +08:00
syntax = "proto3";
2023-02-09 20:36:34 +08:00
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
2023-02-23 19:15:30 +08:00
option go_package = "OpenIM/pkg/proto/friend;friend";
2021-05-26 19:44:38 +08:00
package friend;
2023-02-07 20:28:34 +08:00
message getPaginationFriendsReq{
2023-02-20 11:45:11 +08:00
sdkws.RequestPagination pagination = 1;
string userID = 2;
2021-12-23 17:22:49 +08:00
}
2023-02-07 20:28:34 +08:00
message getPaginationFriendsResp{
2023-02-20 11:45:11 +08:00
repeated sdkws.FriendInfo FriendsInfo = 1;
int32 total = 2;
2021-05-26 19:44:38 +08:00
}
2021-12-23 17:22:49 +08:00
2023-02-07 20:28:34 +08:00
message applyToAddFriendReq{
2023-01-29 19:45:17 +08:00
string fromUserID = 1;
string toUserID = 2;
string reqMsg = 3;
2023-01-30 21:47:29 +08:00
string ex = 4;
2021-12-26 18:47:11 +08:00
}
2023-02-07 20:28:34 +08:00
message applyToAddFriendResp{
2021-05-26 19:44:38 +08:00
}
2021-12-26 18:47:11 +08:00
2023-01-30 21:47:29 +08:00
message importFriendReq{
string ownerUserID = 1;
repeated string friendUserIDs = 2;
2021-12-29 15:50:50 +08:00
}
2023-01-16 15:59:30 +08:00
2023-01-30 21:47:29 +08:00
message importFriendResp{
2021-09-26 14:26:45 +08:00
}
2021-09-22 20:10:38 +08:00
2021-12-26 18:47:11 +08:00
2023-02-07 20:28:34 +08:00
message getPaginationFriendsApplyToReq{
2023-01-29 19:45:17 +08:00
string userID = 1;
2023-02-09 20:36:34 +08:00
sdkws.RequestPagination pagination = 2;
2023-01-29 19:45:17 +08:00
2021-05-26 19:44:38 +08:00
}
2023-02-07 20:28:34 +08:00
message getPaginationFriendsApplyToResp{
2023-02-09 20:36:34 +08:00
repeated sdkws.FriendRequest FriendRequests = 1;
2023-01-29 19:45:17 +08:00
int32 total = 2;
2021-05-26 19:44:38 +08:00
}
2023-02-07 20:28:34 +08:00
message getDesignatedFriendsReq{
2023-02-20 11:45:11 +08:00
string ownerUserID = 1;
repeated string friendUserIDs = 2;
2021-05-26 19:44:38 +08:00
}
2023-02-07 20:28:34 +08:00
message getDesignatedFriendsResp{
2023-02-20 11:45:11 +08:00
repeated sdkws.FriendInfo friendsInfo = 1;
2021-05-26 19:44:38 +08:00
}
2021-12-23 17:22:49 +08:00
2023-01-30 21:47:29 +08:00
message addBlackReq{
string ownerUserID = 1;
string blackUserID = 2;
2021-05-26 19:44:38 +08:00
}
2023-01-30 21:47:29 +08:00
message addBlackResp{
2021-12-26 18:47:11 +08:00
}
2021-05-26 19:44:38 +08:00
2023-01-30 21:47:29 +08:00
message removeBlackReq{
string ownerUserID = 1;
string blackUserID = 2;
2021-05-26 19:44:38 +08:00
}
2023-01-31 09:35:00 +08:00
message removeBlackResp{
2021-12-26 18:47:11 +08:00
}
2021-05-26 19:44:38 +08:00
2023-02-07 20:28:34 +08:00
message getPaginationBlacksReq{
2023-01-29 19:45:17 +08:00
string userID = 1;
2023-02-09 20:36:34 +08:00
sdkws.RequestPagination pagination = 2;
2021-05-26 19:44:38 +08:00
}
2023-02-07 20:28:34 +08:00
message getPaginationBlacksResp{
2023-02-09 20:36:34 +08:00
repeated sdkws.BlackInfo blacks= 1;
2023-01-29 19:45:17 +08:00
int32 total = 2;
2021-05-26 19:44:38 +08:00
}
2021-12-26 18:47:11 +08:00
2023-01-30 21:47:29 +08:00
message isFriendReq{
2023-01-31 11:34:30 +08:00
string userID1 = 1;
string userID2 = 2;
2021-06-28 15:33:26 +08:00
}
2023-01-30 21:47:29 +08:00
message isFriendResp{
2023-01-31 11:34:30 +08:00
bool inUser1Friends = 1; //如果userID2在userID1的好友列表中 true
bool inUser2Friends = 2; //如果userID1在userID2的好友列表中 true
2021-06-28 15:33:26 +08:00
}
2021-12-23 17:22:49 +08:00
2021-12-26 18:47:11 +08:00
2023-01-30 21:47:29 +08:00
message isBlackReq{
2023-01-31 11:34:30 +08:00
string userID1 = 1;
string userID2 = 2;
2021-05-26 19:44:38 +08:00
}
2023-01-30 21:47:29 +08:00
message isBlackResp{
2023-01-31 11:34:30 +08:00
bool inUser1Blacks = 1; //如果userID2在userID1的黑名单列表中 true
bool inUser2Blacks = 2; //如果userID1在userID2的黑名单列表中 true
2021-05-26 19:44:38 +08:00
}
2021-12-26 18:47:11 +08:00
2023-01-30 21:47:29 +08:00
message deleteFriendReq{
string ownerUserID = 1;
string friendUserID = 2;
2021-05-26 19:44:38 +08:00
}
2023-01-30 21:47:29 +08:00
message deleteFriendResp{
2021-12-26 18:47:11 +08:00
}
2021-05-26 19:44:38 +08:00
2021-12-26 18:47:11 +08:00
//process
2023-01-30 21:47:29 +08:00
message respondFriendApplyReq{
string fromUserID = 1; //主动发起的申请者
string toUserID = 2; //被动添加者
2023-01-16 15:59:30 +08:00
int32 handleResult = 3;
string handleMsg = 4;
2021-12-26 18:47:11 +08:00
}
2023-01-30 21:47:29 +08:00
message respondFriendApplyResp{
2021-05-26 19:44:38 +08:00
}
2023-01-30 21:47:29 +08:00
message setFriendRemarkReq{
string ownerUserID = 1;
string friendUserID = 2;
2023-01-29 19:45:17 +08:00
string remark = 3;
2021-05-26 19:44:38 +08:00
}
2023-01-30 21:47:29 +08:00
message setFriendRemarkResp{
2021-12-26 18:47:11 +08:00
}
2023-02-07 20:28:34 +08:00
message getPaginationFriendsApplyFromReq{
2023-01-29 19:47:13 +08:00
string userID = 1;
2023-02-09 20:36:34 +08:00
sdkws.RequestPagination pagination = 2;
2021-12-26 18:47:11 +08:00
}
2023-02-07 20:28:34 +08:00
message getPaginationFriendsApplyFromResp{
2023-02-09 20:36:34 +08:00
repeated sdkws.FriendRequest friendRequests = 1;
2023-01-29 19:45:17 +08:00
int32 total = 2;
2021-12-26 18:47:11 +08:00
}
2021-05-26 19:44:38 +08:00
2023-03-03 18:44:14 +08:00
message getFriendIDsReq {
string userID = 1;
}
message getFriendIDsResp {
2023-03-03 18:55:51 +08:00
repeated string friendIDs = 1;
2023-03-03 18:44:14 +08:00
}
2021-05-26 19:44:38 +08:00
service friend{
2023-01-29 19:19:03 +08:00
//申请加好友
2023-02-07 20:28:34 +08:00
rpc applyToAddFriend(applyToAddFriendReq) returns(applyToAddFriendResp);
2023-01-29 19:19:03 +08:00
//获取收到的好友申请列表
2023-02-07 20:28:34 +08:00
rpc getPaginationFriendsApplyTo(getPaginationFriendsApplyToReq) returns(getPaginationFriendsApplyToResp);
2023-01-29 19:19:03 +08:00
//获取主动发出去的好友申请列表
2023-02-07 20:28:34 +08:00
rpc getPaginationFriendsApplyFrom(getPaginationFriendsApplyFromReq) returns(getPaginationFriendsApplyFromResp);
2023-01-29 19:19:03 +08:00
//添加黑名单
2023-01-30 21:47:29 +08:00
rpc addBlack(addBlackReq) returns(addBlackResp);
2023-01-29 19:19:03 +08:00
//移除黑名单
2023-01-31 09:35:00 +08:00
rpc removeBlack(removeBlackReq) returns(removeBlackResp);
2023-01-29 19:19:03 +08:00
//判断是否好友关系
2023-01-30 21:47:29 +08:00
rpc isFriend(isFriendReq) returns(isFriendResp);
2023-01-29 19:19:03 +08:00
//判断是否在黑名单中
2023-01-30 21:47:29 +08:00
rpc isBlack(isBlackReq) returns(isBlackResp);
2023-01-29 19:19:03 +08:00
//获取黑名单列表
2023-02-07 20:28:34 +08:00
rpc getPaginationBlacks(getPaginationBlacksReq) returns(getPaginationBlacksResp);
2023-01-29 19:19:03 +08:00
//删除好友
2023-01-30 21:47:29 +08:00
rpc deleteFriend(deleteFriendReq) returns(deleteFriendResp);
2023-01-29 19:19:03 +08:00
//对好友申请响应(同意或拒绝)
2023-01-30 21:47:29 +08:00
rpc respondFriendApply(respondFriendApplyReq) returns(respondFriendApplyResp);
2023-01-29 19:19:03 +08:00
//设置好友备注
2023-01-30 21:47:29 +08:00
rpc setFriendRemark(setFriendRemarkReq) returns(setFriendRemarkResp);
2023-01-29 19:19:03 +08:00
//导入好友关系
2023-01-30 21:47:29 +08:00
rpc importFriends(importFriendReq) returns(importFriendResp);
2023-02-07 20:28:34 +08:00
//翻页获取好友列表 无结果不返回错误
rpc getDesignatedFriends(getDesignatedFriendsReq) returns(getDesignatedFriendsResp);
//获取指定好友信息 有id不存在也返回错误
rpc getPaginationFriends(getPaginationFriendsReq) returns (getPaginationFriendsResp);
2023-03-03 18:44:14 +08:00
// 获取好友ID列表
rpc getFriendIDs(getFriendIDsReq) returns (getFriendIDsResp);
2021-05-26 19:44:38 +08:00
}