You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/proto/friend/friend.proto

176 lines
4.2 KiB

syntax = "proto3";
2 years ago
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
2 years ago
option go_package = "OpenIM/pkg/proto/friend;friend";
package OpenIMServer.friend;
message getPaginationFriendsReq{
sdkws.RequestPagination pagination = 1;
string userID = 2;
3 years ago
}
message getPaginationFriendsResp{
repeated sdkws.FriendInfo FriendsInfo = 1;
int32 total = 2;
}
3 years ago
message applyToAddFriendReq{
string fromUserID = 1;
string toUserID = 2;
string reqMsg = 3;
string ex = 4;
3 years ago
}
message applyToAddFriendResp{
}
3 years ago
message importFriendReq{
string ownerUserID = 1;
repeated string friendUserIDs = 2;
3 years ago
}
2 years ago
message importFriendResp{
}
3 years ago
message getPaginationFriendsApplyToReq{
string userID = 1;
2 years ago
sdkws.RequestPagination pagination = 2;
}
message getPaginationFriendsApplyToResp{
2 years ago
repeated sdkws.FriendRequest FriendRequests = 1;
int32 total = 2;
}
message getDesignatedFriendsReq{
string ownerUserID = 1;
repeated string friendUserIDs = 2;
}
message getDesignatedFriendsResp{
repeated sdkws.FriendInfo friendsInfo = 1;
}
3 years ago
message addBlackReq{
string ownerUserID = 1;
string blackUserID = 2;
}
message addBlackResp{
3 years ago
}
message removeBlackReq{
string ownerUserID = 1;
string blackUserID = 2;
}
message removeBlackResp{
3 years ago
}
message getPaginationBlacksReq{
string userID = 1;
2 years ago
sdkws.RequestPagination pagination = 2;
}
message getPaginationBlacksResp{
2 years ago
repeated sdkws.BlackInfo blacks= 1;
int32 total = 2;
}
3 years ago
message isFriendReq{
string userID1 = 1;
string userID2 = 2;
3 years ago
}
message isFriendResp{
bool inUser1Friends = 1; //如果userID2在userID1的好友列表中 true
bool inUser2Friends = 2; //如果userID1在userID2的好友列表中 true
3 years ago
}
3 years ago
3 years ago
message isBlackReq{
string userID1 = 1;
string userID2 = 2;
}
message isBlackResp{
bool inUser1Blacks = 1; //如果userID2在userID1的黑名单列表中 true
bool inUser2Blacks = 2; //如果userID1在userID2的黑名单列表中 true
}
3 years ago
message deleteFriendReq{
string ownerUserID = 1;
string friendUserID = 2;
}
message deleteFriendResp{
3 years ago
}
3 years ago
//process
message respondFriendApplyReq{
string fromUserID = 1; //主动发起的申请者
string toUserID = 2; //被动添加者
2 years ago
int32 handleResult = 3;
string handleMsg = 4;
3 years ago
}
message respondFriendApplyResp{
}
message setFriendRemarkReq{
string ownerUserID = 1;
string friendUserID = 2;
string remark = 3;
}
message setFriendRemarkResp{
3 years ago
}
message getPaginationFriendsApplyFromReq{
string userID = 1;
2 years ago
sdkws.RequestPagination pagination = 2;
3 years ago
}
message getPaginationFriendsApplyFromResp{
2 years ago
repeated sdkws.FriendRequest friendRequests = 1;
int32 total = 2;
3 years ago
}
2 years ago
message getFriendIDsReq {
string userID = 1;
}
message getFriendIDsResp {
2 years ago
repeated string friendIDs = 1;
2 years ago
}
service friend{
//申请加好友
rpc applyToAddFriend(applyToAddFriendReq) returns(applyToAddFriendResp);
//获取收到的好友申请列表
rpc getPaginationFriendsApplyTo(getPaginationFriendsApplyToReq) returns(getPaginationFriendsApplyToResp);
//获取主动发出去的好友申请列表
rpc getPaginationFriendsApplyFrom(getPaginationFriendsApplyFromReq) returns(getPaginationFriendsApplyFromResp);
//添加黑名单
rpc addBlack(addBlackReq) returns(addBlackResp);
//移除黑名单
rpc removeBlack(removeBlackReq) returns(removeBlackResp);
//判断是否好友关系
rpc isFriend(isFriendReq) returns(isFriendResp);
//判断是否在黑名单中
rpc isBlack(isBlackReq) returns(isBlackResp);
//获取黑名单列表
rpc getPaginationBlacks(getPaginationBlacksReq) returns(getPaginationBlacksResp);
//删除好友
rpc deleteFriend(deleteFriendReq) returns(deleteFriendResp);
//对好友申请响应(同意或拒绝)
rpc respondFriendApply(respondFriendApplyReq) returns(respondFriendApplyResp);
//设置好友备注
rpc setFriendRemark(setFriendRemarkReq) returns(setFriendRemarkResp);
//导入好友关系
rpc importFriends(importFriendReq) returns(importFriendResp);
//翻页获取好友列表 无结果不返回错误
rpc getDesignatedFriends(getDesignatedFriendsReq) returns(getDesignatedFriendsResp);
//获取指定好友信息 有id不存在也返回错误
rpc getPaginationFriends(getPaginationFriendsReq) returns (getPaginationFriendsResp);
2 years ago
// 获取好友ID列表
rpc getFriendIDs(getFriendIDsReq) returns (getFriendIDsResp);
}