syntax = "proto3"; // package声明符,用来防止不同的消息类型有命名冲突 package pb_v1; // 用于生成指定语言go的包名称 option go_package = "property-system-gateway/pb/v1"; // 社区邻里分类 message NeighborClassAddRequest { int64 garden_id = 1; // 分类名 string class_name = 2; // 分类图标 string class_pic = 3; // true 开启 false 禁用 bool enable = 4; } message NeighborClassAddReply { } message NeighborClassDelRequest { int64 garden_id = 1; int64 id = 2; } message NeighborClassDelReply { } message NeighborClassUpdateRequest { int64 garden_id = 1; int64 id = 2; string class_name = 3; string class_pic = 4; bool enable = 5; } message NeighborClassUpdateReply { } message NeighborClassItem { int64 id = 1; string class_name = 2; string class_pic = 3; bool enable = 4; // 分类下的文章总数 int64 article_count = 5; // 分类创建时间 string created_at = 6; // 分类结束时间 string updated_at = 7; } message NeighborClassListRequest { int64 garden_id = 1; string class_name = 2; int64 page = 3; int64 page_size = 4; } message NeighborClassListReply { int64 page = 1; int64 total = 2; repeated NeighborClassItem list = 3; } // 社区邻里文章 message NeighborArticleAddRequest { int64 garden_id = 1; // 文章标题 string title = 2; // 文章类容 string content = 3; // 文章图片 repeated string pics = 4; // 分类id int64 class_id = 5; int64 uid = 6; string user_icon = 7; } message NeighborArticleAddReply { } message NeighborArticleDelRequest { int64 garden_id = 1; int64 id = 2; int64 uid = 3; bool admin = 4; } message NeighborArticleDelReply { } message NeighborArticleUpdateRequest { int64 garden_id = 1; string title = 2; string content = 3; repeated string pics = 4; int64 id = 5; int64 uid = 6; } message NeighborArticleUpdateReply { } message NeighborArticleItem { int64 id = 1; string title = 2; string content = 3; repeated string pics = 4; // 文章点赞数 int64 likes = 5; // 评论总数 int64 comment_count = 6; string created_at = 7; string updated_at = 8; // 分类id int64 class_id = 9; // true 本人已点赞 false 本人未点赞 bool like = 10; int64 uid = 11; string user_name = 12; string user_phone = 13; // 用户头像 string user_icon = 14; // 是否是本人发布的文章 bool owner = 15; } message NeighborArticleListRequest { int64 garden_id = 1; int64 page = 2; int64 page_size = 3; string title = 4; int64 class_id = 5; int64 uid = 6; } message NeighborArticleListReply { int64 page = 1; int64 total = 2; repeated NeighborArticleItem list = 3; } message NeighborLikeRequest { int64 garden_id = 1; int64 uid = 2; // 点赞id int64 like_id = 3; // 点赞类型 1 文章 2 评论 int32 like_type = 4; // true 点赞 false 取消点赞 bool like = 5; } message NeighborLikeReply { } // 社区邻里评论 message NeighborCommentAddRequest { int64 garden_id = 1; // pid 和 article_id 二选一, 当为文章评论使用article_id, 当为评论添加子评论使用pid int64 pid = 4; int64 article_id = 5; string content = 6; repeated string pics = 7; int64 uid = 8; string user_icon = 9; } message NeighborCommentAddReply { } message NeighborCommentDelRequest { int64 garden_id = 1; int64 id = 2; int64 uid = 3; bool admin = 4; } message NeighborCommentDelReply { } message NeighborCommentUpdateRequest { int64 garden_id = 1; string content = 2; int64 uid = 3; int64 id = 4; repeated string pics = 5; } message NeighborCommentUpdateReply { } message NeighborCommentListRequest { int64 garden_id = 1; int64 article_id = 2; int64 comment_id = 3; int64 page = 4; int64 page_size = 5; int64 uid = 6; } message NeighborCommentItem { int64 id = 1; string content = 2; int64 uid = 3; string user_name = 4; string user_phone = 5; // 用户头像 string user_icon = 6; repeated string pics = 7; // 子评论数 int64 sub_comment_count = 8; // 点赞数 int64 likes = 9; // 本人是否点赞 bool like = 10; string created_at = 11; string updated_at = 12; // 是否是本人发布的文章 bool owner = 13; } message NeighborCommentListReply { int64 total = 1; int64 page = 2; repeated NeighborCommentItem list = 3; }