refactor: reorganize modules and add Linux build tooling

This commit is contained in:
2026-08-09 12:41:08 +08:00
parent 86024fa81d
commit 5cc5fd92ed
1461 changed files with 4054 additions and 4724 deletions

View File

@@ -0,0 +1,66 @@
syntax = "proto3";
package feed;
option go_package = ".;feed";
message FetchRequest {
int64 page_no=1; // 页数
int64 page_size=2; // 每页记录数
map<string,string> params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11
}
message IdentRequest{
int64 id = 1; // 唯一ID
string identity = 2; // 唯一码
}
message VersionRequest {
int64 version=1; // 时序版本号
}
message SearchRequest {
string keyword=1; //关键词
}
message StatusReply{
string data=1; // 数据
int64 timeseq=2; // 响应时间序列
}
message Empty{
}
// 推文列表
message PostListReply{
repeated PostItem list = 1;
int64 cnt = 2;
}
// 推文
message PostItem{
string identity = 1; // 唯一标识
string content = 2; // 内容
int64 feed_id=3; // 通行证ID
string feed_identity = 4; // 通行证Identity
bool is_open =5; // 是否公开默认为0-公开1-不公开
int64 cnt_unlike = 6; // 点踩数量
int64 cnt_comment = 7; // 评论数量
int64 cnt_like = 8; // 点赞数量
repeated AttachItem attachs = 9; // 附件信息
repeated TagItem tags = 10; // 所属话题
}
// 附件
message AttachItem{
string identity = 1; // 唯一标识
string attach_type = 2; // 文件类型
string url = 3; // 文件路径
}
// 标签
message TagItem {
string key = 1; // 标签唯一码
string content = 2; // 标签内容
}

View File

@@ -0,0 +1,53 @@
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; // 唯一标识
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
package feed;
option go_package =".;feed";
import "blocks.proto";
service Setting{
// 修改个人信息
rpc Info (Empty) returns (Empty){};
// 修改权限信息
rpc Rights (Empty) returns (Empty){};
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
package feed;
option go_package =".;feed";
import "blocks.proto";
service Tag{
// 标签列表
rpc List (FetchRequest) returns (TagListReply){};
// 新建标签
rpc Create (AddTagRequest) returns (StatusReply){};
// 话题相关的文章
rpc PostList (FetchRequest) returns (PostListReply){};
}
message AddTagRequest {
repeated string tags = 1; // 标签名称
}
message TagListReply{
repeated TagItem tags = 1;
int64 total = 2;
}

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
package feed;
option go_package =".;feed";
import "blocks.proto";
// 实时动态
service Timeline{
// 推荐
rpc Recommend (FetchRequest) returns (PostListReply){};
// 好友动态
rpc Friend (FetchRequest) returns (PostListReply){};
// 关注的动态
rpc Follow (FetchRequest) returns (PostListReply){};
// 热门
rpc Hot (FetchRequest) returns (PostListReply){};
}