protoc-gen-slc/proto/post.proto

133 lines
4.0 KiB
Protocol Buffer

syntax = "proto3";
package content;
option go_package = "./;content";
import "blocks.proto";
// 正文
service Post{
//文章列表
rpc PostList(PostListRequest) returns (PostListReply) {};
//获取文章详情
rpc GetPost (GetPostRequest) returns (PostItem) {};
//发布文章
rpc AddPost(PostItem) returns (StatusReply) {};
//修改文章
rpc ModifyPost(PostItem) returns (StatusReply) {};
//删除文章
rpc DeletePost(IdentRequest) returns (StatusReply) {};
// 文章点赞处理
rpc IncrPostLike(PostOpIdentityRequest) returns (StatusReply) {};
rpc DescPostLike(PostOpIdentityRequest) returns (StatusReply) {};
// 文章点踩处理
rpc IncrPostUnlike(PostOpIdentityRequest) returns (StatusReply) {};
rpc DescPostUnlike(PostOpIdentityRequest) returns (StatusReply) {};
//评论列表
rpc CommentList(CommentListRequest) returns (CommentListResponse) {};
//发布评论
rpc AddComment(CommentItem) returns (StatusReply) {};
//修改评论
rpc ModifyComment(CommentItem) returns (StatusReply) {};
//删除评论
rpc DeleteComment(DeleteCommentRequest) returns (StatusReply) {};
// 评论点赞处理
rpc IncrCommentLike(CommentOpIdentityRequest) returns (StatusReply) {};
rpc DescCommentLike(CommentOpIdentityRequest) returns (StatusReply) {};
// 评论点踩处理
rpc IncrCommentUnlike(CommentOpIdentityRequest) returns (StatusReply) {};
rpc DescCommentUnlike(CommentOpIdentityRequest) returns (StatusReply) {};
}
message DeleteCommentRequest{
string identity = 1; // 需要删除的评论的唯一标识
string post_identity = 2; // 文章唯一标识
}
message PostItem{
string identity = 1; // 文章唯一标识
int64 passport_id =2; // 作者ID
string passport_identity =3; // 作者唯一标识
repeated string category_identity_list = 4; //所属分类Identity 列表
repeated string tags_identity_list = 5; // 标签集
string title = 6;
string cover_path = 7; //封面
string author = 8;
string content = 9;
string target_url = 10;// 跳转目标地址
string source_url = 11; // 文章来源地址
int64 hits = 12; //点击量
repeated string accessory = 13; //附件列表
bool has_accessory = 14;//是否有附件,默认没有
string created_at=15;
string updated_at=16;
string description = 17;//简介
int64 like_hits = 18; //点赞量
int64 unlike_hits = 19; //点踩量
int64 comment_hits = 20; //评论量
int32 type = 22;// 用户自定义文章类型
string rights=23; //权限
}
message PostListRequest{
int64 page = 1; // 页码,默认第一页
int64 size = 2; // 单页显示数量,默认10,最多50
string author_identity = 3; //发布者唯一标识,可选
string category_identity = 4; // 文章类型,可选
string keyword = 5;// 根据文章名称模糊查找
int32 type = 6;// 根据用户自定义文章类型过滤,可选,默认0,全部查找
}
message PostListReply{
repeated PostItem data = 1;
int64 count = 2;
}
message GetPostRequest {
string identity = 1; // 必传
string author_identity = 2; // 必传
}
message CommentItem {
string identity = 1;
string Post_identity = 2;
string parent_identity = 3;
string content = 4;
string reply_identity = 5;// 回复者唯一 标识
string created_at = 6;
string updated_at = 7;
repeated CommentItem list = 8;//回复列表
int64 like_hits = 9; //点赞量
int64 unlike_hits = 10; //点踩量
int64 comment_hits = 11; //评论量
}
message CommentListRequest{
string Post_identity = 1;//必填
int64 page = 2; // 页码,默认第一页
int64 size = 3; // 单页显示数量,默认10,最多50
}
message CommentListResponse{
repeated CommentItem list =1;
int64 count = 2;
}
message PostOpIdentityRequest{
string post_identity = 1; //必传
string op_identity = 2; // 必传
}
message CommentOpIdentityRequest{
string comment_identity = 1; //必填
string op_identity = 2;//必填
}