feat: import services and standardize Go 1.26.5
This commit is contained in:
73
apps/base/cms/proto/blocks.proto
Normal file
73
apps/base/cms/proto/blocks.proto
Normal file
@@ -0,0 +1,73 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = ".;cms";
|
||||
|
||||
// 列表请求参数
|
||||
message FetchRequest {
|
||||
int64 page_no = 1 [json_name = "page_no"]; // 页数
|
||||
int64 page_size = 2 [json_name = "page_size"]; // 每页记录数
|
||||
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; //<必传>, 关键词
|
||||
int64 page_no = 2 [json_name = "page_no"]; // 页数
|
||||
int64 page_size = 3 [json_name = "page_size"]; // 每页记录数
|
||||
}
|
||||
|
||||
message StatusReply{
|
||||
int32 code = 1; // 状态码
|
||||
string message = 2; // 状态说明
|
||||
string details = 3; // 数据
|
||||
int64 timeseq = 4; // 响应时间序列
|
||||
}
|
||||
|
||||
// 空结构请求
|
||||
message Empty{
|
||||
}
|
||||
|
||||
// 分类
|
||||
message CategoryItem{
|
||||
string site_identity = 1 [json_name = "site_identity"];
|
||||
int64 id = 2;
|
||||
string identity = 3; // 唯一标识
|
||||
int64 parent_id = 4 [json_name = "parent_id"]; // 为空表示顶级分类
|
||||
string title = 5; // 标题
|
||||
string cover_path = 6 [json_name = "cover_path"]; // 封面图片
|
||||
string intro = 7; // 简介
|
||||
string created_at = 8 [json_name = "created_at"]; // 创建时间
|
||||
string updated_at = 9 [json_name = "updated_at"]; // 更新时间
|
||||
repeated CategoryItem child = 10; // 子集
|
||||
string category_key = 11 [json_name = "category_key"];// 分类标识
|
||||
|
||||
}
|
||||
|
||||
// 标签
|
||||
message TagsItem{
|
||||
int64 id = 1;
|
||||
string identity = 2; // 唯一标识
|
||||
string title = 3; // 标题
|
||||
string cover_path = 4 [json_name = "cover_path"]; // 封面图片
|
||||
string intro = 5; // 简介
|
||||
string created_at = 6 [json_name = "created_at"]; //创建时间
|
||||
}
|
||||
|
||||
// 附件
|
||||
message AccessoryItem{
|
||||
string identity = 1; // 唯一标识
|
||||
string title = 2; // 附件标题
|
||||
string file_path = 3 [json_name = "file_path"]; // 附件文件路径
|
||||
string created_at = 4 [json_name = "created_at"]; //创建时间
|
||||
}
|
||||
71
apps/base/cms/proto/category.proto
Normal file
71
apps/base/cms/proto/category.proto
Normal file
@@ -0,0 +1,71 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = ".;cms";
|
||||
import "blocks.proto";
|
||||
|
||||
// CMS - 分类
|
||||
service Category {
|
||||
// 分类列表
|
||||
rpc Fetch (IdentRequest) returns (CategoryListReply) {};
|
||||
|
||||
// 添加分类
|
||||
rpc Create (CategoryItem) returns (StatusReply) {};
|
||||
|
||||
// 修改分类
|
||||
rpc Modify (ModifyCategoryRequest) returns (StatusReply) {};
|
||||
|
||||
// 删除分类
|
||||
rpc Delete (DeleteCategoryRequest) returns (StatusReply) {};
|
||||
}
|
||||
|
||||
// 分类列表
|
||||
message CategoryListReply {
|
||||
// 数据
|
||||
repeated CategoryItem data = 1;
|
||||
// 总数
|
||||
int64 count = 2;
|
||||
}
|
||||
|
||||
// 添加分类响应
|
||||
message AddCategoryResponse{
|
||||
string identity = 1; // 添加分类响应唯一标识
|
||||
}
|
||||
|
||||
// 添加分类请求
|
||||
message AddCategoryRequest{
|
||||
string site_identity = 1 [json_name = "site_identity"];
|
||||
string identity = 2; // 添加分类请求唯一码
|
||||
int64 parent_id = 3 [json_name = "parent_id"]; // 为空表示顶级分类
|
||||
string title = 4; // 标题
|
||||
string cover_path = 5 [json_name = "cover_path"]; // 封面图片
|
||||
string intro = 6; // 简介
|
||||
string created_at = 7 [json_name = "created_at"]; // 创建时间
|
||||
string updated_at = 8 [json_name = "updated_at"]; // 更新时间
|
||||
repeated CategoryItem data = 9; // 子集
|
||||
}
|
||||
|
||||
// 修改分类请求
|
||||
message ModifyCategoryRequest{
|
||||
string site_identity = 1 [json_name = "site_identity"];
|
||||
string identity = 2; // 修改分类请求唯一标识
|
||||
int64 parent_id = 3 [json_name = "parent_id"]; // 为空表示顶级分类
|
||||
string title = 4; // 标题
|
||||
string cover_path = 5 [json_name = "cover_path"]; // 封面图片
|
||||
string intro = 6; // 简介
|
||||
string created_at = 7 [json_name = "created_at"]; // 创建时间
|
||||
string updated_at = 8 [json_name = "updated_at"]; // 更新时间
|
||||
repeated CategoryItem data = 9; // 子集
|
||||
string category_key = 10[json_name = "category_key"]; // 分类标识
|
||||
|
||||
}
|
||||
|
||||
// 删除分类请求
|
||||
message DeleteCategoryRequest{
|
||||
string identity = 1; // 删除分类请求唯一标识
|
||||
}
|
||||
|
||||
// 关键字分类
|
||||
message KeywordRequest{
|
||||
string keyword = 1; // 关键字
|
||||
|
||||
}
|
||||
71
apps/base/cms/proto/pages.proto
Normal file
71
apps/base/cms/proto/pages.proto
Normal file
@@ -0,0 +1,71 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = ".;cms";
|
||||
import "blocks.proto";
|
||||
|
||||
// 单页管理
|
||||
service Pages{
|
||||
// 单页列表
|
||||
rpc Fetch(PagesListRequest) returns (PagesListReply) {};
|
||||
|
||||
//获取单页详情 By Identity
|
||||
rpc GetByIdentity (GetPagesRequest) returns (PagesItem) {};
|
||||
|
||||
//获取单页详情 By Key
|
||||
rpc GetByKey (GetPagesByKeyRequest) returns (PagesItem) {};
|
||||
|
||||
//发布单页
|
||||
rpc Create(PagesItem) returns (StatusReply) {};
|
||||
|
||||
//修改单页
|
||||
rpc Modify(PagesItem) returns (StatusReply) {};
|
||||
|
||||
//删除单页
|
||||
rpc Delete(IdentRequest) returns (StatusReply) {};
|
||||
}
|
||||
|
||||
// 根据KEY获取内容请求
|
||||
message GetPagesByKeyRequest{
|
||||
string key = 1; //<必传> 内容页的key
|
||||
}
|
||||
|
||||
// 文章
|
||||
message PagesItem{
|
||||
string site_identity = 1 [json_name = "site_identity"];
|
||||
string identity = 2; // 文章唯一标识
|
||||
string created_at = 3 [json_name = "created_at"]; // 创建时间
|
||||
string updated_at = 4 [json_name = "updated_at"]; //更新时间
|
||||
int32 post_type = 5 [json_name = "post_type"]; // 用户自定义文章类型
|
||||
string rights = 6; //权限
|
||||
string title = 7; // <必传>,标题
|
||||
string key = 8; //<必传> 内容页的key
|
||||
string description = 9; //简介
|
||||
string cover_path = 10 [json_name = "cover_path"]; //封面
|
||||
string content = 11; // <必传>,内容
|
||||
bool has_accessory = 12 [json_name = "has_accessory"]; //是否有附件,默认没有
|
||||
|
||||
repeated string accessory_identity_array = 13 [json_name = "accessory_identity_array"]; //附件Identity 列表
|
||||
repeated AccessoryItem accessory_data = 14 [json_name = "accessory_data"]; //附件数据
|
||||
repeated TagsItem tags_data = 15 [json_name = "tags_data"]; // 标签数据
|
||||
repeated string tags_identity_array = 16 [json_name = "tags_identity_array"]; // 标签集Identity 列表
|
||||
int64 hits = 17; //点击量
|
||||
}
|
||||
|
||||
// 文章列表请求
|
||||
message PagesListRequest{
|
||||
int64 page = 1; // 页码,默认第一页
|
||||
int64 size = 2; // 单页显示数量,默认10,最多50
|
||||
string keyword = 3; // 根据文章名称模糊查找
|
||||
int32 type = 4; // 根据用户自定义文章类型过滤,可选,默认0,全部查找
|
||||
}
|
||||
|
||||
// 文章列表回复
|
||||
message PagesListReply{
|
||||
repeated PagesItem data = 1; // 数据
|
||||
int64 count = 2; // 总数量
|
||||
}
|
||||
|
||||
// 获取文章详情请求
|
||||
message GetPagesRequest {
|
||||
string identity = 1; // 必传唯一标识
|
||||
}
|
||||
185
apps/base/cms/proto/post.proto
Normal file
185
apps/base/cms/proto/post.proto
Normal file
@@ -0,0 +1,185 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = ".;cms";
|
||||
import "blocks.proto";
|
||||
|
||||
// 正文
|
||||
service Post{
|
||||
//文章列表
|
||||
rpc Fetch(PostListRequest) returns (PostListReply) {};
|
||||
|
||||
//获取文章详情 By Identity
|
||||
rpc GetByIdentity (GetPostRequest) returns (PostItem) {};
|
||||
|
||||
//获取文章详情 By Key
|
||||
rpc GetByKey (GetPostByKeyRequest) returns (PostItem) {};
|
||||
|
||||
//搜索文章
|
||||
rpc Search (SearchRequest) returns (PostListReply) {};
|
||||
|
||||
//发布文章
|
||||
rpc Create(PostItem) returns (StatusReply) {};
|
||||
|
||||
//修改文章
|
||||
rpc Modify(PostItem) returns (StatusReply) {};
|
||||
|
||||
//删除文章
|
||||
rpc Delete(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 [json_name = "post_identity"]; // 文章唯一标识
|
||||
}
|
||||
|
||||
// 根据KEY获取内容请求
|
||||
message GetPostByKeyRequest{
|
||||
string key = 3; //<必传> 内容页的key
|
||||
}
|
||||
|
||||
// 文章
|
||||
message PostItem{
|
||||
string site_identity = 1 [json_name = "site_identity"];
|
||||
string identity = 2; // 文章唯一标识
|
||||
int64 owner_id = 3 [json_name = "owner_id"]; // 作者ID
|
||||
string owner_identity = 4 [json_name = "owner_identity"]; // 作者唯一标识
|
||||
repeated string category_identity_array = 5 [json_name = "category_identity_array"]; // <必传>,所属分类Identity 列表
|
||||
repeated string tags_identity_array = 6 [json_name = "tags_identity_array"]; // 标签集Identity 列表
|
||||
string title = 7; // <必传>,标题
|
||||
string cover_path = 8 [json_name = "cover_path"]; //封面
|
||||
string author = 9; // 作者
|
||||
string author_identity = 10 [json_name = "author_identity"];
|
||||
string content = 11; // <必传>,内容
|
||||
string target_url = 12 [json_name = "target_url"]; // 跳转目标地址
|
||||
string source_url = 13 [json_name = "source_url"]; // 文章来源地址
|
||||
int64 hits = 14; //点击量
|
||||
repeated string accessory_identity_array = 15 [json_name = "accessory_identity_array"]; //附件Identity 列表
|
||||
bool has_accessory = 16 [json_name = "has_accessory"]; //是否有附件,默认没有
|
||||
string created_at = 17 [json_name = "created_at"]; // 创建时间
|
||||
string updated_at = 18 [json_name = "updated_at"]; //更新时间
|
||||
string description = 19; //简介
|
||||
int64 like_hits = 20 [json_name = "like_hits"]; //点赞量
|
||||
int64 unlike_hits = 21 [json_name = "unlike_hits"]; //点踩量
|
||||
int64 comment_hits = 22 [json_name = "comment_hits"]; //评论量
|
||||
int32 post_type = 23 [json_name = "post_type"]; // 用户自定义文章类型
|
||||
string rights = 24; //权限
|
||||
|
||||
repeated CategoryItem category_data = 26 [json_name = "category_data"]; // 分类数据
|
||||
repeated TagsItem tags_data = 27 [json_name = "tags_data"]; // 标签数据
|
||||
repeated AccessoryItem accessory_data = 28 [json_name = "accessory_data"]; //附件数据
|
||||
|
||||
string lang = 29 [json_name = "lang"]; // 语言
|
||||
string source_origin = 30 [json_name = "source_origin"]; // 来源方简称
|
||||
|
||||
string extend_url = 31 [json_name = "extend_url"]; // 扩展:URL
|
||||
string extend_data = 32 [json_name = "extend_data"]; // 扩展:数据
|
||||
string extend_img = 33 [json_name = "extend_img"]; // 扩展:图片
|
||||
string extend_desc = 34 [json_name = "extend_desc"]; // 扩展:描述
|
||||
|
||||
string published = 35 [json_name = "published"]; // 事件发生时间
|
||||
|
||||
// 扩展:文章唯一键值(用于URL等)
|
||||
string hash = 36 [json_name = "hash"];
|
||||
}
|
||||
|
||||
// 文章列表请求
|
||||
message PostListRequest{
|
||||
int64 page = 1; // 页码,默认第一页
|
||||
int64 size = 2; // 单页显示数量,默认10,最多50
|
||||
string author_identity = 3 [json_name = "author_identity"]; //发布者唯一标识,可选
|
||||
string category_identity = 4 [json_name = "category_identity"]; // 文章类型,可选
|
||||
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 [json_name = "author_identity"]; // 必传作者唯一标识
|
||||
}
|
||||
|
||||
// 评论
|
||||
message CommentItem {
|
||||
string identity = 1; // 评论唯一标识
|
||||
string post_identity = 2 [json_name = "post_identity"]; // 文章唯一标识
|
||||
int64 parent_id = 3 [json_name = "parent_id"]; // 为空表示顶级评论
|
||||
string Cms = 4; // 评论内容
|
||||
string reply_identity = 5 [json_name = "reply_identity"]; // 回复者唯一 标识
|
||||
string created_at = 6 [json_name = "created_at"]; // 创建时间
|
||||
string updated_at = 7 [json_name = "updated_at"]; // 更新时间
|
||||
repeated CommentItem list = 8; //回复列表
|
||||
int64 like_hits = 9 [json_name = "like_hits"]; // 点赞量
|
||||
int64 unlike_hits = 10 [json_name = "unlike_hits"]; // 点踩量
|
||||
int64 comment_hits = 11 [json_name = "comment_hits"]; // 评论量
|
||||
string owner_name = 12 [json_name = "owner_name"]; // 作者名称
|
||||
string owner_identity = 13 [json_name = "owner_identity"]; // 作者标识
|
||||
string role = 14 [json_name = "role"]; // 角色
|
||||
}
|
||||
|
||||
// 评论列表
|
||||
message CommentListRequest{
|
||||
string post_identity = 1 [json_name = "post_identity"]; //必填 评论唯一标识
|
||||
int64 page = 2; // 页码,默认第一页
|
||||
int64 size = 3; // 单页显示数量,默认10,最多50
|
||||
}
|
||||
|
||||
// 评论列表回复
|
||||
message CommentListResponse{
|
||||
repeated CommentItem list = 1; // 数据
|
||||
int64 count = 2; // 总数量
|
||||
}
|
||||
|
||||
// 文章点赞处理请求
|
||||
message PostOpIdentityRequest{
|
||||
string post_identity = 1 [json_name = "post_identity"]; //必传 文章唯一标识
|
||||
string op_identity = 2 [json_name = "op_identity"]; // 必传 操作者唯一标识
|
||||
}
|
||||
|
||||
// 评论点赞处理请求
|
||||
message CommentOpIdentityRequest{
|
||||
string comment_identity = 1 [json_name = "comment_identity"]; //必填 评论唯一标识
|
||||
string op_identity = 2 [json_name = "op_identity"]; //必填 操作者唯一标识
|
||||
}
|
||||
44
apps/base/cms/proto/site.proto
Normal file
44
apps/base/cms/proto/site.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = ".;cms";
|
||||
import "blocks.proto";
|
||||
|
||||
// CMS - 站点
|
||||
service Site {
|
||||
// 站点列表
|
||||
rpc Fetch (Empty) returns (SiteListReply) {};
|
||||
|
||||
// 站点详情
|
||||
rpc Get (IdentRequest) returns (SiteItem) {};
|
||||
|
||||
// 添加站点
|
||||
rpc Create (SiteItem) returns (StatusReply) {};
|
||||
|
||||
// 修改站点
|
||||
rpc Modify (SiteItem) returns (StatusReply) {};
|
||||
|
||||
// 删除站点
|
||||
rpc Delete (IdentRequest) returns (StatusReply) {};
|
||||
}
|
||||
|
||||
// 站点列表
|
||||
message SiteListReply {
|
||||
// 数据
|
||||
repeated SiteItem data = 1;
|
||||
// 总数
|
||||
int64 count = 2;
|
||||
}
|
||||
|
||||
// 添加站点请求
|
||||
message SiteItem{
|
||||
int64 id = 1; // 唯一ID
|
||||
string identity = 2; // 添加站点请求唯一码
|
||||
string title = 3; // 标题
|
||||
string description = 4 ; // 站点描述
|
||||
string icon_path = 5 [json_name = "icon_path"]; // 站点图标
|
||||
string keywords = 6; // 关键字
|
||||
string domain = 7; // 站点域名
|
||||
string seo = 8; // SEO
|
||||
string theme = 9; // 站点主题
|
||||
string configs = 10; // 站点配置
|
||||
}
|
||||
25
apps/base/cms/proto/tags.proto
Normal file
25
apps/base/cms/proto/tags.proto
Normal file
@@ -0,0 +1,25 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = ".;cms";
|
||||
import "blocks.proto";
|
||||
|
||||
// 标签
|
||||
service Tags {
|
||||
//标签列表
|
||||
rpc Fetch (IdentRequest) returns (TagsListReply) {};
|
||||
|
||||
//创建标签
|
||||
rpc Create(TagsItem) returns (StatusReply) {};
|
||||
|
||||
//修改标签
|
||||
rpc Modify(TagsItem) returns (StatusReply) {};
|
||||
|
||||
//删除标签
|
||||
rpc Delete(IdentRequest) returns (StatusReply) {};
|
||||
}
|
||||
|
||||
// 标签列表
|
||||
message TagsListReply {
|
||||
repeated TagsItem data = 1; // 数据
|
||||
int64 count = 2; // 总数
|
||||
}
|
||||
Reference in New Issue
Block a user