54 lines
1.3 KiB
Protocol Buffer
54 lines
1.3 KiB
Protocol Buffer
|
|
syntax = "proto3";
|
|||
|
|
package feed;
|
|||
|
|
option go_package =".;feed";
|
|||
|
|
import "blocks.proto";
|
|||
|
|
|
|||
|
|
// 推文相关操作
|
|||
|
|
service Post{
|
|||
|
|
|
|||
|
|
// 推文列表
|
|||
|
|
rpc Fetch(FetchRequest) returns (PostListReply){};
|
|||
|
|
// 新建推文
|
|||
|
|
rpc Create (PostItem) returns (StatusReply){};
|
|||
|
|
// 修改推文
|
|||
|
|
rpc Change (PostItem) returns (StatusReply){};
|
|||
|
|
// 删除推文
|
|||
|
|
rpc Remove (IdentRequest) returns (StatusReply){};
|
|||
|
|
|
|||
|
|
// 评论列表
|
|||
|
|
rpc CommentList (FetchRequest) returns (CommentListReply){};
|
|||
|
|
// 新建评论
|
|||
|
|
rpc AddComment (CommentItem) returns (StatusReply){};
|
|||
|
|
// 删除评论
|
|||
|
|
rpc DeleteComment (IdentRequest) returns (StatusReply){};
|
|||
|
|
|
|||
|
|
// 计数操作
|
|||
|
|
rpc Action (PostActionRequest) returns (StatusReply){};
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 推文评论列表
|
|||
|
|
message CommentListReply{
|
|||
|
|
repeated CommentItem list = 1; // 评论列表
|
|||
|
|
int64 total = 2;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
message CommentItem{
|
|||
|
|
string identity = 1; // 评论identity
|
|||
|
|
string post_identity = 2; // 被评论唯一标识
|
|||
|
|
string feed_identity=3; // 评论人唯一标识
|
|||
|
|
string content = 4; // 评论内容
|
|||
|
|
repeated CommentItem sub_comment =5; // 子评论
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
message PostActionRequest{
|
|||
|
|
string action_op=1; //操作运作:ilike,unlike
|
|||
|
|
string action_type=2; //类别:推文,评论
|
|||
|
|
string identity = 3; // 唯一标识
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|