151 lines
4.1 KiB
Protocol Buffer
151 lines
4.1 KiB
Protocol Buffer
syntax = "proto3";
|
||
package relation;
|
||
option go_package = "bsm/full/module/social/relation/pb;relation";
|
||
import "module/social/relation/proto/const.proto";
|
||
|
||
// relation-关系管理:好友
|
||
service Friend{
|
||
/** 基础操作 **/
|
||
|
||
//搜索
|
||
rpc Search(blocks.SearchRequest) returns (PartFriendReply);
|
||
|
||
//获取好友列表
|
||
rpc Fetch(blocks.VersionRequest) returns (FriendsReply);
|
||
|
||
//获取用户信息卡片
|
||
rpc Get(blocks.IdentRequest) returns (blocks.RelationItem);
|
||
|
||
//修改好友备注名称,如果要清除备注,直接nickname传空值
|
||
rpc ModifyNickname(ModifyNicknameRequest) returns (blocks.DataStatusReply);
|
||
|
||
//受你欢迎的,置顶
|
||
rpc DoPopular(blocks.IdentRequest) returns (blocks.DataStatusReply);
|
||
|
||
//取消受欢迎的,取消置顶
|
||
rpc UndoPopular(blocks.IdentRequest) returns (blocks.DataStatusReply);
|
||
|
||
//删除好友
|
||
rpc Delete(blocks.IdentRequest) returns (blocks.DataStatusReply);
|
||
|
||
/** 好友申请管理 **/
|
||
|
||
//好友申请列表
|
||
rpc ApplyFetch(blocks.VersionRequest) returns (ApplyFetchReply);
|
||
|
||
//好友申请详情
|
||
rpc ApplyGet(blocks.IdentRequest) returns (FriendApplyGetReply);
|
||
|
||
//好友申请
|
||
rpc ApplyDo(ApplyDoRequest) returns (blocks.DataStatusReply);
|
||
|
||
//好友申请Do:留言
|
||
rpc ApplyDoMessage(ApplyMessageRequest) returns (blocks.DataStatusReply);
|
||
|
||
//好友申请Do:确认
|
||
rpc ApplyDoPass(ApplyDoPassRequest) returns (blocks.DataStatusReply);
|
||
|
||
//好友申请Do:拒绝
|
||
rpc ApplyDoReject(blocks.IdentRequest) returns (blocks.DataStatusReply);
|
||
|
||
/** 好友标签管理 **/
|
||
|
||
//获取标签列表
|
||
rpc TagFetch(blocks.Empty) returns (FriendTagsReply);
|
||
|
||
//获取标签成员
|
||
rpc TagMemberFetch(blocks.IdentRequest) returns (PartFriendReply);
|
||
|
||
//创建标签
|
||
rpc TagDoCreate(TagDoCreateRequest) returns (blocks.DataStatusReply);
|
||
|
||
//更新标签成员
|
||
rpc TagDoUpdate(TagDoUpdateRequest) returns (blocks.DataStatusReply);
|
||
|
||
}
|
||
|
||
|
||
|
||
message ApplyFetchReply {
|
||
int32 total=1; // 总记录数
|
||
int64 version=2; //版本号
|
||
repeated ApplyItem applys=3;
|
||
}
|
||
|
||
message ApplyItem {
|
||
string identity=1; // 唯一标识
|
||
blocks.RelationItem from=2;
|
||
MessageItem message=3;
|
||
string created_at=4; //时间
|
||
int32 status =5; // 状态
|
||
}
|
||
|
||
message ApplyDoRequest {
|
||
int64 to_id = 1; // 目标人的唯一ID
|
||
string to_identity=2; //目标人的唯一标识
|
||
string body=3; //留言正文
|
||
}
|
||
|
||
message ApplyDoPassRequest{
|
||
int64 friend_relation_id = 1; // 为将要通过的好友会员通行证唯一ID
|
||
string friend_relation_identity = 2; // 为将要通过的好友会员通行证唯一Identity
|
||
string apply_identity = 3; // 申请的唯一标识
|
||
}
|
||
|
||
message ApplyMessageRequest {
|
||
int64 apply_id = 1; // 申请ID
|
||
string body=2; //留言正文
|
||
}
|
||
|
||
message PartFriendReply {
|
||
int32 total=1; // 总记录数
|
||
int64 version=2; //版本号
|
||
repeated blocks.RelationItem friends=4; //好友信息
|
||
}
|
||
|
||
message FriendsReply {
|
||
int32 total=1; // 总记录数
|
||
int64 version=2; //版本号
|
||
repeated TagItem tags=3; //分组标签信息
|
||
repeated blocks.RelationItem friends=4; //好友信息
|
||
}
|
||
|
||
message FriendApplyGetReply{
|
||
blocks.RelationItem data=1; // 会员信息卡片
|
||
repeated MessageItem message=2; //聊天记录
|
||
}
|
||
|
||
message MessageItem {
|
||
string relation_identity=1; //发送者
|
||
string body=2; //正文
|
||
string created_at=3; //时间
|
||
}
|
||
|
||
message ModifyNicknameRequest{
|
||
string identity=1; // 会员唯一标识
|
||
string nickname=2; // 新的备注名称
|
||
}
|
||
|
||
message FriendTagsReply {
|
||
int64 total=1; // 总记录数
|
||
repeated TagItem data=2;
|
||
}
|
||
|
||
message TagItem {
|
||
int64 id=1;//好友标签ID
|
||
string identity=2; // 标签唯一标识
|
||
int64 friend_total=3; // 标签成员统计
|
||
string tag_name=4; // 标签名称
|
||
}
|
||
|
||
message TagDoCreateRequest{
|
||
string tag_name=1; // 标签名称
|
||
repeated string friend_identity=2; //成员identity
|
||
}
|
||
|
||
message TagDoUpdateRequest{
|
||
string tag_identity=1; // 标签唯一标识
|
||
string friend_identity=2; //成员identity
|
||
string direction=3; //操作方式:ADD增加成员,DEL删除成员
|
||
}
|