From 568b6a07f7d70f6948c52ca0c8b9b0ebee5a815d Mon Sep 17 00:00:00 2001 From: truthhun <1272881215@qq.com> Date: Mon, 13 Mar 2023 22:14:29 +0800 Subject: [PATCH] api docs --- api/v1/article.pb.go | 16 +- api/v1/article.proto | 57 +- api/v1/attachment.pb.go | 24 +- api/v1/attachment.proto | 56 +- api/v1/banner.pb.go | 15 + api/v1/banner.proto | 52 +- docs/api.md | 2493 ------------------------- docs/api/article.md | 158 ++ docs/api/attachment.md | 168 ++ docs/api/banner.md | 158 ++ docs/api/category.md | 157 ++ docs/api/comment.md | 201 ++ docs/api/config.md | 299 +++ docs/api/document.md | 404 ++++ docs/api/favorite.md | 154 ++ docs/api/friendlink.md | 155 ++ docs/api/group.md | 211 +++ docs/api/health.md | 93 + docs/api/permission.md | 168 ++ docs/api/report.md | 141 ++ docs/api/user.md | 409 ++++ docs/openapi.yaml | 3918 ++------------------------------------- 22 files changed, 3185 insertions(+), 6322 deletions(-) delete mode 100644 docs/api.md create mode 100644 docs/api/article.md create mode 100644 docs/api/attachment.md create mode 100644 docs/api/banner.md create mode 100644 docs/api/category.md create mode 100644 docs/api/comment.md create mode 100644 docs/api/config.md create mode 100644 docs/api/document.md create mode 100644 docs/api/favorite.md create mode 100644 docs/api/friendlink.md create mode 100644 docs/api/group.md create mode 100644 docs/api/health.md create mode 100644 docs/api/permission.md create mode 100644 docs/api/report.md create mode 100644 docs/api/user.md diff --git a/api/v1/article.pb.go b/api/v1/article.pb.go index 508d362..9eebf44 100644 --- a/api/v1/article.pb.go +++ b/api/v1/article.pb.go @@ -33,6 +33,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// 文章 type Article struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` @@ -149,6 +150,7 @@ func (m *Article) GetUpdatedAt() *time.Time { return nil } +// 删除文章请求,传入单个或者多个文章ID type DeleteArticleRequest struct { Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` } @@ -193,7 +195,7 @@ func (m *DeleteArticleRequest) GetId() []int64 { return nil } -// 根据ID或者文章标识获取文章 +// 根据ID或者文章标识获取文章,二选一 type GetArticleRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` @@ -246,6 +248,7 @@ func (m *GetArticleRequest) GetIdentifier() string { return "" } +// 文章列表请求 type ListArticleRequest struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` @@ -322,6 +325,7 @@ func (m *ListArticleRequest) GetOrder() string { return "" } +// 文章列表响应 type ListArticleReply struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Article []*Article `protobuf:"bytes,2,rep,name=article,proto3" json:"article,omitempty"` @@ -439,10 +443,15 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ArticleAPIClient interface { + // 创建文章 CreateArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 更新文章 UpdateArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除文章 DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 获取文章 GetArticle(ctx context.Context, in *GetArticleRequest, opts ...grpc.CallOption) (*Article, error) + // 文章列表 ListArticle(ctx context.Context, in *ListArticleRequest, opts ...grpc.CallOption) (*ListArticleReply, error) } @@ -501,10 +510,15 @@ func (c *articleAPIClient) ListArticle(ctx context.Context, in *ListArticleReque // ArticleAPIServer is the server API for ArticleAPI service. type ArticleAPIServer interface { + // 创建文章 CreateArticle(context.Context, *Article) (*emptypb.Empty, error) + // 更新文章 UpdateArticle(context.Context, *Article) (*emptypb.Empty, error) + // 删除文章 DeleteArticle(context.Context, *DeleteArticleRequest) (*emptypb.Empty, error) + // 获取文章 GetArticle(context.Context, *GetArticleRequest) (*Article, error) + // 文章列表 ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error) } diff --git a/api/v1/article.proto b/api/v1/article.proto index ea89af0..b705d48 100644 --- a/api/v1/article.proto +++ b/api/v1/article.proto @@ -12,41 +12,50 @@ option go_package = "moredoc/api/v1;v1"; option java_multiple_files = true; option java_package = "api.v1"; +// 文章 message Article { - int64 id = 1; - string identifier = 2; - string author = 3; - int64 view_count = 4; - string title = 5; - string keywords = 6; - string description = 7; - string content = 8; - google.protobuf.Timestamp created_at = 9 [ (gogoproto.stdtime) = true ]; - google.protobuf.Timestamp updated_at = 10 [ (gogoproto.stdtime) = true ]; + int64 id = 1; // 文章ID + string identifier = 2; // 文章唯一标识 + string author = 3; // 文章作者。如果为空,则使用网站名称作为作者 + int64 view_count = 4; // 文章浏览次数 + string title = 5; // 文章标题 + string keywords = 6; // 文章关键字 + string description = 7; // 文章描述 + string content = 8; // 文章内容 + google.protobuf.Timestamp created_at = 9 + [ (gogoproto.stdtime) = true ]; // 文章创建时间 + google.protobuf.Timestamp updated_at = 10 + [ (gogoproto.stdtime) = true ]; // 文章更新时间 } +// 删除文章请求,传入单个或者多个文章ID message DeleteArticleRequest { repeated int64 id = 1; } -// 根据ID或者文章标识获取文章 -message GetArticleRequest { - int64 id = 1; - string identifier = 2; - } +// 根据ID或者文章标识获取文章,二选一 +message GetArticleRequest { + int64 id = 1; // 文章ID + string identifier = 2; // 文章唯一标识 +} +// 文章列表请求 message ListArticleRequest { - int64 page = 1; - int64 size = 2; - string wd = 3; - repeated string field = 4; - string order = 5; + int64 page = 1; // 页码 + int64 size = 2; // 每页数量 + string wd = 3; // 搜索关键字 + repeated string field = 4; // 查询字段 + string order = 5; // 排序字段,根据指定的字段倒序排序 } +// 文章列表响应 message ListArticleReply { - int64 total = 1; - repeated Article article = 2; + int64 total = 1; // 文章总数 + repeated Article article = 2; // 文章列表 } +// 文章API服务 service ArticleAPI { + + // 创建文章 rpc CreateArticle(Article) returns (google.protobuf.Empty) { option (google.api.http) = { post : '/api/v1/article', @@ -54,6 +63,7 @@ service ArticleAPI { }; } + // 更新文章 rpc UpdateArticle(Article) returns (google.protobuf.Empty) { option (google.api.http) = { put : '/api/v1/article', @@ -61,18 +71,21 @@ service ArticleAPI { }; } + // 删除文章 rpc DeleteArticle(DeleteArticleRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete : '/api/v1/article', }; } + // 获取文章 rpc GetArticle(GetArticleRequest) returns (Article) { option (google.api.http) = { get : '/api/v1/article', }; } + // 文章列表 rpc ListArticle(ListArticleRequest) returns (ListArticleReply) { option (google.api.http) = { get : '/api/v1/article/list', diff --git a/api/v1/attachment.pb.go b/api/v1/attachment.pb.go index b28cd25..338d69c 100644 --- a/api/v1/attachment.pb.go +++ b/api/v1/attachment.pb.go @@ -33,12 +33,14 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// 附件 type Attachment struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` - UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - TypeId int64 `protobuf:"varint,4,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` - Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + TypeId int64 `protobuf:"varint,4,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` + Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type,omitempty"` + // 横幅,6: 分类封面,7: 配置 Enable bool `protobuf:"varint,6,opt,name=enable,proto3" json:"enable,omitempty"` Path string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"` Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` @@ -213,6 +215,7 @@ func (m *Attachment) GetUpdatedAt() *time.Time { return nil } +// 删除附件请求 type DeleteAttachmentRequest struct { Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` } @@ -257,6 +260,7 @@ func (m *DeleteAttachmentRequest) GetId() []int64 { return nil } +// 获取附件请求 type GetAttachmentRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -301,6 +305,7 @@ func (m *GetAttachmentRequest) GetId() int64 { return 0 } +// 列出附件请求 type ListAttachmentRequest struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` @@ -393,6 +398,7 @@ func (m *ListAttachmentRequest) GetExt() string { return "" } +// 列出附件响应 type ListAttachmentReply struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Attachment []*Attachment `protobuf:"bytes,2,rep,name=attachment,proto3" json:"attachment,omitempty"` @@ -515,9 +521,13 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type AttachmentAPIClient interface { + // 更新附件 UpdateAttachment(ctx context.Context, in *Attachment, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除附件。这里只是软删除,不会真正删除附件,默认24小时候会真正清除附件 DeleteAttachment(ctx context.Context, in *DeleteAttachmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 查询附件 GetAttachment(ctx context.Context, in *GetAttachmentRequest, opts ...grpc.CallOption) (*Attachment, error) + // 列出附件 ListAttachment(ctx context.Context, in *ListAttachmentRequest, opts ...grpc.CallOption) (*ListAttachmentReply, error) } @@ -567,9 +577,13 @@ func (c *attachmentAPIClient) ListAttachment(ctx context.Context, in *ListAttach // AttachmentAPIServer is the server API for AttachmentAPI service. type AttachmentAPIServer interface { + // 更新附件 UpdateAttachment(context.Context, *Attachment) (*emptypb.Empty, error) + // 删除附件。这里只是软删除,不会真正删除附件,默认24小时候会真正清除附件 DeleteAttachment(context.Context, *DeleteAttachmentRequest) (*emptypb.Empty, error) + // 查询附件 GetAttachment(context.Context, *GetAttachmentRequest) (*Attachment, error) + // 列出附件 ListAttachment(context.Context, *ListAttachmentRequest) (*ListAttachmentReply, error) } diff --git a/api/v1/attachment.proto b/api/v1/attachment.proto index 460cd60..0e97976 100644 --- a/api/v1/attachment.proto +++ b/api/v1/attachment.proto @@ -12,48 +12,57 @@ option go_package = "moredoc/api/v1;v1"; option java_multiple_files = true; option java_package = "api.v1"; +// 附件 message Attachment { - int64 id = 1; - string hash = 2; - int64 user_id = 3; - int64 type_id = 4; - int32 type = 5; - bool enable = 6; - string path = 7; - string name = 8; - int64 size = 9; - int64 width = 10; - int64 height = 11; - string ext = 12; - string ip = 13; - string username = 16; // 用户名称 + int64 id = 1; // 附件ID + string hash = 2; // 附件哈希值,MD5 + int64 user_id = 3; // 上传用户ID + int64 type_id = 4; // 附件类型ID,如果是文档类型,则为文档ID + int32 type = 5; // 附件类型,0: 未知,1: 头像,2: 文档,3: 文章,4: 评论,5: + // 横幅,6: 分类封面,7: 配置 + bool enable = 6; // 是否启用 + string path = 7; // 附件路径 + string name = 8; // 附件名称 + int64 size = 9; // 附件大小,单位:字节 + int64 width = 10; // 附件宽度,单位:像素。针对图片附件 + int64 height = 11; // 附件高度,单位:像素。针对图片附件 + string ext = 12; // 扩展名,如:.docx + string ip = 13; // 上传IP地址 + string username = 16; // 用户名称 string type_name = 17; // 附件类型名称 string description = 18; // 附件描述、备注 - google.protobuf.Timestamp created_at = 14 [ (gogoproto.stdtime) = true ]; - google.protobuf.Timestamp updated_at = 15 [ (gogoproto.stdtime) = true ]; + google.protobuf.Timestamp created_at = 14 + [ (gogoproto.stdtime) = true ]; // 创建时间 + google.protobuf.Timestamp updated_at = 15 + [ (gogoproto.stdtime) = true ]; // 更新时间 } +// 删除附件请求 message DeleteAttachmentRequest { repeated int64 id = 1; } +// 获取附件请求 message GetAttachmentRequest { int64 id = 1; } +// 列出附件请求 message ListAttachmentRequest { - int64 page = 1; - int64 size = 2; - string wd = 3; // 搜索关键字 - repeated bool enable = 4; + int64 page = 1; // 页码 + int64 size = 2; // 每页数量 + string wd = 3; // 搜索关键字 + repeated bool enable = 4; // 是否启用 repeated int64 user_id = 5; // 用户ID repeated int64 type = 6; // 类型 - string ext = 7; // 扩展名 + string ext = 7; // 扩展名 } +// 列出附件响应 message ListAttachmentReply { int64 total = 1; repeated Attachment attachment = 2; } - // 附件服务。只有管理员才有权限操作 +// 附件服务。只有管理员才有权限操作 service AttachmentAPI { + // 更新附件 rpc UpdateAttachment(Attachment) returns (google.protobuf.Empty) { option (google.api.http) = { put : '/api/v1/attachment', @@ -61,6 +70,7 @@ service AttachmentAPI { }; } + // 删除附件。这里只是软删除,不会真正删除附件,默认24小时候会真正清除附件 rpc DeleteAttachment(DeleteAttachmentRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -68,12 +78,14 @@ service AttachmentAPI { }; } + // 查询附件 rpc GetAttachment(GetAttachmentRequest) returns (Attachment) { option (google.api.http) = { get : '/api/v1/attachment', }; } + // 列出附件 rpc ListAttachment(ListAttachmentRequest) returns (ListAttachmentReply) { option (google.api.http) = { get : '/api/v1/attachment/list', diff --git a/api/v1/banner.pb.go b/api/v1/banner.pb.go index 2e314b5..fd03aaf 100644 --- a/api/v1/banner.pb.go +++ b/api/v1/banner.pb.go @@ -33,6 +33,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// banner,轮播图 type Banner struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` @@ -149,6 +150,7 @@ func (m *Banner) GetUpdatedAt() *time.Time { return nil } +// 删除横幅 type DeleteBannerRequest struct { Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"` } @@ -193,6 +195,7 @@ func (m *DeleteBannerRequest) GetId() []int64 { return nil } +// 获取横幅 type GetBannerRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -237,6 +240,7 @@ func (m *GetBannerRequest) GetId() int64 { return 0 } +// 横幅列表请求 type ListBannerRequest struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` @@ -321,6 +325,7 @@ func (m *ListBannerRequest) GetField() []string { return nil } +// 横幅列表 type ListBannerReply struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Banner []*Banner `protobuf:"bytes,2,rep,name=banner,proto3" json:"banner,omitempty"` @@ -438,10 +443,15 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type BannerAPIClient interface { + // 创建横幅 CreateBanner(ctx context.Context, in *Banner, opts ...grpc.CallOption) (*Banner, error) + // 更新横幅 UpdateBanner(ctx context.Context, in *Banner, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 删除横幅 DeleteBanner(ctx context.Context, in *DeleteBannerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 查询横幅 GetBanner(ctx context.Context, in *GetBannerRequest, opts ...grpc.CallOption) (*Banner, error) + // 横幅列表 ListBanner(ctx context.Context, in *ListBannerRequest, opts ...grpc.CallOption) (*ListBannerReply, error) } @@ -500,10 +510,15 @@ func (c *bannerAPIClient) ListBanner(ctx context.Context, in *ListBannerRequest, // BannerAPIServer is the server API for BannerAPI service. type BannerAPIServer interface { + // 创建横幅 CreateBanner(context.Context, *Banner) (*Banner, error) + // 更新横幅 UpdateBanner(context.Context, *Banner) (*emptypb.Empty, error) + // 删除横幅 DeleteBanner(context.Context, *DeleteBannerRequest) (*emptypb.Empty, error) + // 查询横幅 GetBanner(context.Context, *GetBannerRequest) (*Banner, error) + // 横幅列表 ListBanner(context.Context, *ListBannerRequest) (*ListBannerReply, error) } diff --git a/api/v1/banner.proto b/api/v1/banner.proto index e0988b1..587afdb 100644 --- a/api/v1/banner.proto +++ b/api/v1/banner.proto @@ -12,38 +12,48 @@ option go_package = "moredoc/api/v1;v1"; option java_multiple_files = true; option java_package = "api.v1"; +// banner,轮播图 message Banner { - int64 id = 1; - string title = 2; - string path = 3; - int32 sort = 4; - bool enable = 5; - int32 type = 6; - string url = 7; - string description = 8; - google.protobuf.Timestamp created_at = 9 [ (gogoproto.stdtime) = true ]; - google.protobuf.Timestamp updated_at = 10 [ (gogoproto.stdtime) = true ]; + int64 id = 1; // 主键 + string title = 2; // 标题,名称 + string path = 3; // 图片地址 + int32 sort = 4; // 排序,值越大越靠前 + bool enable = 5; // 是否启用 + int32 type = 6; // 类型,如PC横幅、小程序横幅等,见 web/utils/enum.js 中的枚举 + string url = 7; // 跳转地址 + string description = 8; // 描述 + google.protobuf.Timestamp created_at = 9 + [ (gogoproto.stdtime) = true ]; // 创建时间 + google.protobuf.Timestamp updated_at = 10 + [ (gogoproto.stdtime) = true ]; // 更新时间 } -message DeleteBannerRequest {repeated int64 id = 1; } +// 删除横幅 +message DeleteBannerRequest { repeated int64 id = 1; } +// 获取横幅 message GetBannerRequest { int64 id = 1; } +// 横幅列表请求 message ListBannerRequest { - int64 page = 1; - int64 size = 2; - repeated int32 type = 3; - repeated bool enable = 4; - string wd = 5; - repeated string field = 6; + int64 page = 1; // 页码 + int64 size = 2; // 每页数量 + repeated int32 type = 3; // 类型 + repeated bool enable = 4; // 是否启用 + string wd = 5; // 搜索关键字 + repeated string field = 6; // 查询字段,不指定,则查询全部 } +// 横幅列表 message ListBannerReply { - int64 total = 1; - repeated Banner banner = 2; + int64 total = 1; // 总数 + repeated Banner banner = 2; // 横幅数组 } +// 横幅API服务 service BannerAPI { + + // 创建横幅 rpc CreateBanner(Banner) returns (Banner) { option (google.api.http) = { post : '/api/v1/banner', @@ -51,6 +61,7 @@ service BannerAPI { }; } + // 更新横幅 rpc UpdateBanner(Banner) returns (google.protobuf.Empty) { option (google.api.http) = { put : '/api/v1/banner', @@ -58,18 +69,21 @@ service BannerAPI { }; } + // 删除横幅 rpc DeleteBanner(DeleteBannerRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete : '/api/v1/banner', }; } + // 查询横幅 rpc GetBanner(GetBannerRequest) returns (Banner) { option (google.api.http) = { get : '/api/v1/banner', }; } + // 横幅列表 rpc ListBanner(ListBannerRequest) returns (ListBannerReply) { option (google.api.http) = { get : '/api/v1/banner/list', diff --git a/docs/api.md b/docs/api.md deleted file mode 100644 index debef1c..0000000 --- a/docs/api.md +++ /dev/null @@ -1,2493 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [api/v1/article.proto](#api_v1_article-proto) - - [Article](#api-v1-Article) - - [DeleteArticleRequest](#api-v1-DeleteArticleRequest) - - [GetArticleRequest](#api-v1-GetArticleRequest) - - [ListArticleReply](#api-v1-ListArticleReply) - - [ListArticleRequest](#api-v1-ListArticleRequest) - - - [ArticleAPI](#api-v1-ArticleAPI) - -- [api/v1/attachment.proto](#api_v1_attachment-proto) - - [Attachment](#api-v1-Attachment) - - [DeleteAttachmentRequest](#api-v1-DeleteAttachmentRequest) - - [GetAttachmentRequest](#api-v1-GetAttachmentRequest) - - [ListAttachmentReply](#api-v1-ListAttachmentReply) - - [ListAttachmentRequest](#api-v1-ListAttachmentRequest) - - - [AttachmentAPI](#api-v1-AttachmentAPI) - -- [api/v1/banner.proto](#api_v1_banner-proto) - - [Banner](#api-v1-Banner) - - [DeleteBannerRequest](#api-v1-DeleteBannerRequest) - - [GetBannerRequest](#api-v1-GetBannerRequest) - - [ListBannerReply](#api-v1-ListBannerReply) - - [ListBannerRequest](#api-v1-ListBannerRequest) - - - [BannerAPI](#api-v1-BannerAPI) - -- [api/v1/category.proto](#api_v1_category-proto) - - [Category](#api-v1-Category) - - [DeleteCategoryRequest](#api-v1-DeleteCategoryRequest) - - [GetCategoryRequest](#api-v1-GetCategoryRequest) - - [ListCategoryReply](#api-v1-ListCategoryReply) - - [ListCategoryRequest](#api-v1-ListCategoryRequest) - - - [CategoryAPI](#api-v1-CategoryAPI) - -- [api/v1/comment.proto](#api_v1_comment-proto) - - [CheckCommentRequest](#api-v1-CheckCommentRequest) - - [Comment](#api-v1-Comment) - - [CreateCommentRequest](#api-v1-CreateCommentRequest) - - [DeleteCommentRequest](#api-v1-DeleteCommentRequest) - - [GetCommentRequest](#api-v1-GetCommentRequest) - - [ListCommentReply](#api-v1-ListCommentReply) - - [ListCommentRequest](#api-v1-ListCommentRequest) - - - [CommentAPI](#api-v1-CommentAPI) - -- [api/v1/config.proto](#api_v1_config-proto) - - [Config](#api-v1-Config) - - [ConfigCaptcha](#api-v1-ConfigCaptcha) - - [ConfigFooter](#api-v1-ConfigFooter) - - [ConfigSecurity](#api-v1-ConfigSecurity) - - [ConfigSystem](#api-v1-ConfigSystem) - - [Configs](#api-v1-Configs) - - [EnvDependent](#api-v1-EnvDependent) - - [Envs](#api-v1-Envs) - - [ListConfigRequest](#api-v1-ListConfigRequest) - - [Settings](#api-v1-Settings) - - [Stats](#api-v1-Stats) - - - [ConfigAPI](#api-v1-ConfigAPI) - -- [api/v1/document.proto](#api_v1_document-proto) - - [CreateDocumentItem](#api-v1-CreateDocumentItem) - - [CreateDocumentRequest](#api-v1-CreateDocumentRequest) - - [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) - - [Document](#api-v1-Document) - - [DocumentScore](#api-v1-DocumentScore) - - [DownloadDocumentReply](#api-v1-DownloadDocumentReply) - - [GetDocumentRequest](#api-v1-GetDocumentRequest) - - [ListDocumentForHomeItem](#api-v1-ListDocumentForHomeItem) - - [ListDocumentForHomeRequest](#api-v1-ListDocumentForHomeRequest) - - [ListDocumentForHomeResponse](#api-v1-ListDocumentForHomeResponse) - - [ListDocumentReply](#api-v1-ListDocumentReply) - - [ListDocumentRequest](#api-v1-ListDocumentRequest) - - [RecoverRecycleDocumentRequest](#api-v1-RecoverRecycleDocumentRequest) - - [SearchDocumentReply](#api-v1-SearchDocumentReply) - - [SearchDocumentRequest](#api-v1-SearchDocumentRequest) - - [SetDocumentRecommendRequest](#api-v1-SetDocumentRecommendRequest) - - - [DocumentAPI](#api-v1-DocumentAPI) - - [RecycleAPI](#api-v1-RecycleAPI) - -- [api/v1/favorite.proto](#api_v1_favorite-proto) - - [DeleteFavoriteRequest](#api-v1-DeleteFavoriteRequest) - - [Favorite](#api-v1-Favorite) - - [GetFavoriteRequest](#api-v1-GetFavoriteRequest) - - [ListFavoriteReply](#api-v1-ListFavoriteReply) - - [ListFavoriteRequest](#api-v1-ListFavoriteRequest) - - - [FavoriteAPI](#api-v1-FavoriteAPI) - -- [api/v1/friendlink.proto](#api_v1_friendlink-proto) - - [DeleteFriendlinkRequest](#api-v1-DeleteFriendlinkRequest) - - [Friendlink](#api-v1-Friendlink) - - [GetFriendlinkRequest](#api-v1-GetFriendlinkRequest) - - [ListFriendlinkReply](#api-v1-ListFriendlinkReply) - - [ListFriendlinkRequest](#api-v1-ListFriendlinkRequest) - - - [FriendlinkAPI](#api-v1-FriendlinkAPI) - -- [api/v1/group.proto](#api_v1_group-proto) - - [DeleteGroupRequest](#api-v1-DeleteGroupRequest) - - [GetGroupPermissionRequest](#api-v1-GetGroupPermissionRequest) - - [GetGroupRequest](#api-v1-GetGroupRequest) - - [Group](#api-v1-Group) - - [GroupPermissions](#api-v1-GroupPermissions) - - [ListGroupReply](#api-v1-ListGroupReply) - - [ListGroupRequest](#api-v1-ListGroupRequest) - - [UpdateGroupPermissionRequest](#api-v1-UpdateGroupPermissionRequest) - - - [GroupAPI](#api-v1-GroupAPI) - -- [api/v1/health.proto](#api_v1_health-proto) - - [PingRequest](#-PingRequest) - - [PongReply](#-PongReply) - - - [HealthAPI](#-HealthAPI) - -- [api/v1/permission.proto](#api_v1_permission-proto) - - [DeletePermissionRequest](#api-v1-DeletePermissionRequest) - - [GetPermissionReply](#api-v1-GetPermissionReply) - - [GetPermissionRequest](#api-v1-GetPermissionRequest) - - [ListPermissionReply](#api-v1-ListPermissionReply) - - [ListPermissionRequest](#api-v1-ListPermissionRequest) - - [Permission](#api-v1-Permission) - - - [PermissionAPI](#api-v1-PermissionAPI) - -- [api/v1/report.proto](#api_v1_report-proto) - - [DeleteReportRequest](#api-v1-DeleteReportRequest) - - [ListReportReply](#api-v1-ListReportReply) - - [ListReportRequest](#api-v1-ListReportRequest) - - [Report](#api-v1-Report) - - - [ReportAPI](#api-v1-ReportAPI) - -- [api/v1/user.proto](#api_v1_user-proto) - - [DeleteUserRequest](#api-v1-DeleteUserRequest) - - [Dynamic](#api-v1-Dynamic) - - [FindPasswordRequest](#api-v1-FindPasswordRequest) - - [GetUserCaptchaReply](#api-v1-GetUserCaptchaReply) - - [GetUserCaptchaRequest](#api-v1-GetUserCaptchaRequest) - - [GetUserPermissionsReply](#api-v1-GetUserPermissionsReply) - - [GetUserRequest](#api-v1-GetUserRequest) - - [ListUserDynamicReply](#api-v1-ListUserDynamicReply) - - [ListUserDynamicRequest](#api-v1-ListUserDynamicRequest) - - [ListUserReply](#api-v1-ListUserReply) - - [ListUserRequest](#api-v1-ListUserRequest) - - [LoginReply](#api-v1-LoginReply) - - [RegisterAndLoginRequest](#api-v1-RegisterAndLoginRequest) - - [SetUserRequest](#api-v1-SetUserRequest) - - [Sign](#api-v1-Sign) - - [UpdateUserPasswordRequest](#api-v1-UpdateUserPasswordRequest) - - [User](#api-v1-User) - - - [UserAPI](#api-v1-UserAPI) - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## api/v1/article.proto - - - - - -### Article - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| identifier | [string](#string) | | | -| author | [string](#string) | | | -| view_count | [int64](#int64) | | | -| title | [string](#string) | | | -| keywords | [string](#string) | | | -| description | [string](#string) | | | -| content | [string](#string) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### DeleteArticleRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### GetArticleRequest -根据ID或者文章标识获取文章 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| identifier | [string](#string) | | | - - - - - - - - -### ListArticleReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| article | [Article](#api-v1-Article) | repeated | | - - - - - - - - -### ListArticleRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| wd | [string](#string) | | | -| field | [string](#string) | repeated | | -| order | [string](#string) | | | - - - - - - - - - - - - - - -### ArticleAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateArticle | [Article](#api-v1-Article) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| UpdateArticle | [Article](#api-v1-Article) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| DeleteArticle | [DeleteArticleRequest](#api-v1-DeleteArticleRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| GetArticle | [GetArticleRequest](#api-v1-GetArticleRequest) | [Article](#api-v1-Article) | | -| ListArticle | [ListArticleRequest](#api-v1-ListArticleRequest) | [ListArticleReply](#api-v1-ListArticleReply) | | - - - - - - -

Top

- -## api/v1/attachment.proto - - - - - -### Attachment - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| hash | [string](#string) | | | -| user_id | [int64](#int64) | | | -| type_id | [int64](#int64) | | | -| type | [int32](#int32) | | | -| enable | [bool](#bool) | | | -| path | [string](#string) | | | -| name | [string](#string) | | | -| size | [int64](#int64) | | | -| width | [int64](#int64) | | | -| height | [int64](#int64) | | | -| ext | [string](#string) | | | -| ip | [string](#string) | | | -| username | [string](#string) | | 用户名称 | -| type_name | [string](#string) | | 附件类型名称 | -| description | [string](#string) | | 附件描述、备注 | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### DeleteAttachmentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### GetAttachmentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### ListAttachmentReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| attachment | [Attachment](#api-v1-Attachment) | repeated | | - - - - - - - - -### ListAttachmentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| wd | [string](#string) | | 搜索关键字 | -| enable | [bool](#bool) | repeated | | -| user_id | [int64](#int64) | repeated | 用户ID | -| type | [int64](#int64) | repeated | 类型 | -| ext | [string](#string) | | 扩展名 | - - - - - - - - - - - - - - -### AttachmentAPI -附件服务。只有管理员才有权限操作 - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| UpdateAttachment | [Attachment](#api-v1-Attachment) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| DeleteAttachment | [DeleteAttachmentRequest](#api-v1-DeleteAttachmentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| GetAttachment | [GetAttachmentRequest](#api-v1-GetAttachmentRequest) | [Attachment](#api-v1-Attachment) | | -| ListAttachment | [ListAttachmentRequest](#api-v1-ListAttachmentRequest) | [ListAttachmentReply](#api-v1-ListAttachmentReply) | | - - - - - - -

Top

- -## api/v1/banner.proto - - - - - -### Banner - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| title | [string](#string) | | | -| path | [string](#string) | | | -| sort | [int32](#int32) | | | -| enable | [bool](#bool) | | | -| type | [int32](#int32) | | | -| url | [string](#string) | | | -| description | [string](#string) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### DeleteBannerRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### GetBannerRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### ListBannerReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| banner | [Banner](#api-v1-Banner) | repeated | | - - - - - - - - -### ListBannerRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| type | [int32](#int32) | repeated | | -| enable | [bool](#bool) | repeated | | -| wd | [string](#string) | | | -| field | [string](#string) | repeated | | - - - - - - - - - - - - - - -### BannerAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateBanner | [Banner](#api-v1-Banner) | [Banner](#api-v1-Banner) | | -| UpdateBanner | [Banner](#api-v1-Banner) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| DeleteBanner | [DeleteBannerRequest](#api-v1-DeleteBannerRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| GetBanner | [GetBannerRequest](#api-v1-GetBannerRequest) | [Banner](#api-v1-Banner) | | -| ListBanner | [ListBannerRequest](#api-v1-ListBannerRequest) | [ListBannerReply](#api-v1-ListBannerReply) | | - - - - - - -

Top

- -## api/v1/category.proto - - - - - -### Category - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | -| parent_id | [int32](#int32) | | | -| title | [string](#string) | | | -| doc_count | [int32](#int32) | | | -| sort | [int32](#int32) | | | -| enable | [bool](#bool) | | | -| cover | [string](#string) | | 分类封面 | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### DeleteCategoryRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### GetCategoryRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### ListCategoryReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| category | [Category](#api-v1-Category) | repeated | | - - - - - - - - -### ListCategoryRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| parent_id | [int64](#int64) | repeated | | -| wd | [string](#string) | | | -| enable | [bool](#bool) | repeated | | -| field | [string](#string) | repeated | | - - - - - - - - - - - - - - -### CategoryAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| UpdateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| DeleteCategory | [DeleteCategoryRequest](#api-v1-DeleteCategoryRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| GetCategory | [GetCategoryRequest](#api-v1-GetCategoryRequest) | [Category](#api-v1-Category) | | -| ListCategory | [ListCategoryRequest](#api-v1-ListCategoryRequest) | [ListCategoryReply](#api-v1-ListCategoryReply) | | - - - - - - -

Top

- -## api/v1/comment.proto - - - - - -### CheckCommentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | -| status | [int32](#int32) | | | - - - - - - - - -### Comment - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| id | [int64](#int64) | | | -| parent_id | [int64](#int64) | | | -| content | [string](#string) | | | -| document_id | [int64](#int64) | | | -| status | [int32](#int32) | | | -| comment_count | [int32](#int32) | | | -| user_id | [int64](#int64) | | | -| user | [User](#api-v1-User) | | | -| document_title | [string](#string) | | | - - - - - - - - -### CreateCommentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| document_id | [int64](#int64) | | | -| parent_id | [int64](#int64) | | | -| content | [string](#string) | | | -| captcha_id | [string](#string) | | | -| captcha | [string](#string) | | | - - - - - - - - -### DeleteCommentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### GetCommentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### ListCommentReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| comment | [Comment](#api-v1-Comment) | repeated | | - - - - - - - - -### ListCommentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| wd | [string](#string) | | | -| field | [string](#string) | repeated | | -| order | [string](#string) | | | -| status | [int32](#int32) | repeated | | -| document_id | [int64](#int64) | | | -| user_id | [int64](#int64) | | | -| parent_id | [int64](#int64) | repeated | | -| with_document_title | [bool](#bool) | | | - - - - - - - - - - - - - - -### CommentAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateComment | [CreateCommentRequest](#api-v1-CreateCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| UpdateComment | [Comment](#api-v1-Comment) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新评论,仅限管理员操作 | -| DeleteComment | [DeleteCommentRequest](#api-v1-DeleteCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 管理员或用户自己删除自己的评论 | -| GetComment | [GetCommentRequest](#api-v1-GetCommentRequest) | [Comment](#api-v1-Comment) | 获取单个评论 | -| ListComment | [ListCommentRequest](#api-v1-ListCommentRequest) | [ListCommentReply](#api-v1-ListCommentReply) | 获取评论列表 | -| CheckComment | [CheckCommentRequest](#api-v1-CheckCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 审核评论 | - - - - - - -

Top

- -## api/v1/config.proto - - - - - -### Config - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| label | [string](#string) | | | -| name | [string](#string) | | | -| value | [string](#string) | | | -| placeholder | [string](#string) | | | -| input_type | [string](#string) | | | -| category | [string](#string) | | | -| sort | [int32](#int32) | | | -| options | [string](#string) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### ConfigCaptcha -验证码配置 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| length | [int32](#int32) | | | -| width | [int32](#int32) | | | -| height | [int32](#int32) | | | -| type | [string](#string) | | | - - - - - - - - -### ConfigFooter -底链配置项 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| about | [string](#string) | | | -| contact | [string](#string) | | | -| agreement | [string](#string) | | | -| copyright | [string](#string) | | | -| feedback | [string](#string) | | | - - - - - - - - -### ConfigSecurity -安全配置 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| is_close | [bool](#bool) | | | -| close_statement | [string](#string) | | | -| enable_register | [bool](#bool) | | | -| enable_captcha_login | [bool](#bool) | | | -| enable_captcha_register | [bool](#bool) | | | -| enable_captcha_comment | [bool](#bool) | | | -| enable_captcha_find_password | [bool](#bool) | | | -| enable_captcha_upload | [bool](#bool) | | | -| max_document_size | [int32](#int32) | | | -| document_allowed_ext | [string](#string) | repeated | | - - - - - - - - -### ConfigSystem -系统配置项 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| domain | [string](#string) | | | -| title | [string](#string) | | | -| keywords | [string](#string) | | | -| description | [string](#string) | | | -| logo | [string](#string) | | | -| favicon | [string](#string) | | | -| icp | [string](#string) | | | -| analytics | [string](#string) | | | -| sitename | [string](#string) | | | -| copyright_start_year | [string](#string) | | | -| register_background | [string](#string) | | | -| login_background | [string](#string) | | | -| recommend_words | [string](#string) | repeated | | -| version | [string](#string) | | 程序版本号 | - - - - - - - - -### Configs - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| config | [Config](#api-v1-Config) | repeated | | - - - - - - - - -### EnvDependent - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | 依赖名称 | -| description | [string](#string) | | 依赖描述 | -| is_installed | [bool](#bool) | | 是否已安装 | -| error | [string](#string) | | 错误信息 | -| checked_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 检测时间 | -| cmd | [string](#string) | | 检测命令 | -| is_required | [bool](#bool) | | 是否必须 | - - - - - - - - -### Envs - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| envs | [EnvDependent](#api-v1-EnvDependent) | repeated | | - - - - - - - - -### ListConfigRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| category | [string](#string) | repeated | | - - - - - - - - -### Settings - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| system | [ConfigSystem](#api-v1-ConfigSystem) | | | -| footer | [ConfigFooter](#api-v1-ConfigFooter) | | | -| security | [ConfigSecurity](#api-v1-ConfigSecurity) | | ConfigCaptcha captcha = 4; | - - - - - - - - -### Stats - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| user_count | [int64](#int64) | | | -| document_count | [int64](#int64) | | | -| category_count | [int64](#int64) | | | -| article_count | [int64](#int64) | | | -| comment_count | [int64](#int64) | | | -| banner_count | [int64](#int64) | | | -| friendlink_count | [int64](#int64) | | | -| os | [string](#string) | | | -| version | [string](#string) | | | -| hash | [string](#string) | | | -| build_at | [string](#string) | | | -| report_count | [int64](#int64) | | | - - - - - - - - - - - - - - -### ConfigAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| GetSettings | [.google.protobuf.Empty](#google-protobuf-Empty) | [Settings](#api-v1-Settings) | 获取系统配置(针对所有用户,只读) | -| UpdateConfig | [Configs](#api-v1-Configs) | [.google.protobuf.Empty](#google-protobuf-Empty) | UpdateConfig 更新配置 | -| ListConfig | [ListConfigRequest](#api-v1-ListConfigRequest) | [Configs](#api-v1-Configs) | ListConfig 查询配置项 | -| GetStats | [.google.protobuf.Empty](#google-protobuf-Empty) | [Stats](#api-v1-Stats) | 获取系统配置 | -| GetEnvs | [.google.protobuf.Empty](#google-protobuf-Empty) | [Envs](#api-v1-Envs) | 获取系统环境依赖检测 | -| UpdateSitemap | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新站点地图 | - - - - - - -

Top

- -## api/v1/document.proto - - - - - -### CreateDocumentItem - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| title | [string](#string) | | | -| attachment_id | [int64](#int64) | | | -| price | [int32](#int32) | | | - - - - - - - - -### CreateDocumentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| overwrite | [bool](#bool) | | | -| category_id | [int64](#int64) | repeated | | -| document | [CreateDocumentItem](#api-v1-CreateDocumentItem) | repeated | | - - - - - - - - -### DeleteDocumentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### Document - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| title | [string](#string) | | | -| keywords | [string](#string) | | | -| description | [string](#string) | | | -| user_id | [int64](#int64) | | | -| cover | [string](#string) | | | -| width | [int32](#int32) | | | -| height | [int32](#int32) | | | -| preview | [int32](#int32) | | | -| pages | [int32](#int32) | | | -| uuid | [string](#string) | | | -| download_count | [int32](#int32) | | | -| view_count | [int32](#int32) | | | -| favorite_count | [int32](#int32) | | | -| comment_count | [int32](#int32) | | | -| score | [int32](#int32) | | | -| score_count | [int32](#int32) | | | -| price | [int32](#int32) | | | -| size | [int64](#int64) | | | -| status | [int32](#int32) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| deleted_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| recommend_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| deleted_user_id | [int64](#int64) | | | -| username | [string](#string) | | | -| category_id | [int64](#int64) | repeated | | -| deleted_username | [string](#string) | | | -| ext | [string](#string) | | | -| attachment | [Attachment](#api-v1-Attachment) | | | -| user | [User](#api-v1-User) | | | -| enable_gzip | [bool](#bool) | | | - - - - - - - - -### DocumentScore - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| document_id | [int64](#int64) | | | -| user_id | [int64](#int64) | | | -| score | [int32](#int32) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### DownloadDocumentReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| url | [string](#string) | | | - - - - - - - - -### GetDocumentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| with_author | [bool](#bool) | | | - - - - - - - - -### ListDocumentForHomeItem - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| category_id | [int64](#int64) | | | -| category_cover | [string](#string) | | | -| category_name | [string](#string) | | | -| document | [Document](#api-v1-Document) | repeated | | - - - - - - - - -### ListDocumentForHomeRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| limit | [int64](#int64) | | | - - - - - - - - -### ListDocumentForHomeResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| document | [ListDocumentForHomeItem](#api-v1-ListDocumentForHomeItem) | repeated | | - - - - - - - - -### ListDocumentReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| document | [Document](#api-v1-Document) | repeated | | - - - - - - - - -### ListDocumentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| wd | [string](#string) | | | -| field | [string](#string) | repeated | | -| order | [string](#string) | | | -| category_id | [int64](#int64) | repeated | | -| user_id | [int64](#int64) | repeated | | -| status | [int32](#int32) | repeated | | -| is_recommend | [bool](#bool) | repeated | | -| limit | [int64](#int64) | | | - - - - - - - - -### RecoverRecycleDocumentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### SearchDocumentReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| spend | [string](#string) | | 搜索耗时 | -| document | [Document](#api-v1-Document) | repeated | | - - - - - - - - -### SearchDocumentRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int32](#int32) | | | -| size | [int32](#int32) | | | -| wd | [string](#string) | | | -| category_id | [int64](#int64) | repeated | 分类 | -| sort | [string](#string) | | 排序 | -| ext | [string](#string) | | 类型 | - - - - - - - - -### SetDocumentRecommendRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | -| type | [int32](#int32) | | 0, 取消推荐,1:推荐 2:重新推荐 | - - - - - - - - - - - - - - -### DocumentAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| ListDocumentForHome | [ListDocumentForHomeRequest](#api-v1-ListDocumentForHomeRequest) | [ListDocumentForHomeResponse](#api-v1-ListDocumentForHomeResponse) | | -| SetDocumentRecommend | [SetDocumentRecommendRequest](#api-v1-SetDocumentRecommendRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| CreateDocument | [CreateDocumentRequest](#api-v1-CreateDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| UpdateDocument | [Document](#api-v1-Document) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| DeleteDocument | [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| GetDocument | [GetDocumentRequest](#api-v1-GetDocumentRequest) | [Document](#api-v1-Document) | | -| GetRelatedDocuments | [Document](#api-v1-Document) | [ListDocumentReply](#api-v1-ListDocumentReply) | | -| DownloadDocument | [Document](#api-v1-Document) | [DownloadDocumentReply](#api-v1-DownloadDocumentReply) | | -| ListDocument | [ListDocumentRequest](#api-v1-ListDocumentRequest) | [ListDocumentReply](#api-v1-ListDocumentReply) | | -| SearchDocument | [SearchDocumentRequest](#api-v1-SearchDocumentRequest) | [SearchDocumentReply](#api-v1-SearchDocumentReply) | | -| SetDocumentScore | [DocumentScore](#api-v1-DocumentScore) | [.google.protobuf.Empty](#google-protobuf-Empty) | 设置文档评分 | -| GetDocumentScore | [DocumentScore](#api-v1-DocumentScore) | [DocumentScore](#api-v1-DocumentScore) | 获取当前登录用户的文档评分 | - - - - -### RecycleAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| ListRecycleDocument | [ListDocumentRequest](#api-v1-ListDocumentRequest) | [ListDocumentReply](#api-v1-ListDocumentReply) | 文档回收站列表 | -| RecoverRecycleDocument | [RecoverRecycleDocumentRequest](#api-v1-RecoverRecycleDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 恢复回收站文档,支持恢复单个文档或者是批量恢复 | -| DeleteRecycleDocument | [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除回收站文档 | -| ClearRecycleDocument | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 清空回收站文档 | - - - - - - -

Top

- -## api/v1/favorite.proto - - - - - -### DeleteFavoriteRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### Favorite - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| user_id | [int64](#int64) | | | -| document_id | [int64](#int64) | | | -| title | [string](#string) | | | -| ext | [string](#string) | | | -| score | [int32](#int32) | | | -| size | [int64](#int64) | | | -| pages | [int32](#int32) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### GetFavoriteRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| document_id | [int64](#int64) | | | - - - - - - - - -### ListFavoriteReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| favorite | [Favorite](#api-v1-Favorite) | repeated | | - - - - - - - - -### ListFavoriteRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| user_id | [int64](#int64) | | | - - - - - - - - - - - - - - -### FavoriteAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateFavorite | [Favorite](#api-v1-Favorite) | [Favorite](#api-v1-Favorite) | 添加收藏 | -| DeleteFavorite | [DeleteFavoriteRequest](#api-v1-DeleteFavoriteRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 取消收藏 | -| GetFavorite | [GetFavoriteRequest](#api-v1-GetFavoriteRequest) | [Favorite](#api-v1-Favorite) | 根据文章id,查询用户是否有收藏某篇文档 | -| ListFavorite | [ListFavoriteRequest](#api-v1-ListFavoriteRequest) | [ListFavoriteReply](#api-v1-ListFavoriteReply) | 查询用户的收藏 | - - - - - - -

Top

- -## api/v1/friendlink.proto - - - - - -### DeleteFriendlinkRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### Friendlink - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | -| title | [string](#string) | | | -| link | [string](#string) | | | -| description | [string](#string) | | | -| sort | [int32](#int32) | | | -| enable | [bool](#bool) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### GetFriendlinkRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### ListFriendlinkReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| friendlink | [Friendlink](#api-v1-Friendlink) | repeated | | -| total | [int64](#int64) | | | - - - - - - - - -### ListFriendlinkRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int32](#int32) | | | -| size | [int32](#int32) | | | -| wd | [string](#string) | | | -| enable | [bool](#bool) | repeated | | -| field | [string](#string) | repeated | | - - - - - - - - - - - - - - -### FriendlinkAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateFriendlink | [Friendlink](#api-v1-Friendlink) | [Friendlink](#api-v1-Friendlink) | | -| UpdateFriendlink | [Friendlink](#api-v1-Friendlink) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| DeleteFriendlink | [DeleteFriendlinkRequest](#api-v1-DeleteFriendlinkRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| GetFriendlink | [GetFriendlinkRequest](#api-v1-GetFriendlinkRequest) | [Friendlink](#api-v1-Friendlink) | | -| ListFriendlink | [ListFriendlinkRequest](#api-v1-ListFriendlinkRequest) | [ListFriendlinkReply](#api-v1-ListFriendlinkReply) | | - - - - - - -

Top

- -## api/v1/group.proto - - - - - -### DeleteGroupRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### GetGroupPermissionRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### GetGroupRequest -根据组名或者ID获取用户组 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| title | [string](#string) | | | - - - - - - - - -### Group - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| title | [string](#string) | | | -| color | [string](#string) | | | -| is_default | [bool](#bool) | | | -| is_display | [bool](#bool) | | | -| description | [string](#string) | | | -| user_count | [int32](#int32) | | | -| sort | [int32](#int32) | | | -| enable_upload | [bool](#bool) | | | -| enable_comment_approval | [bool](#bool) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### GroupPermissions - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| permission_id | [int64](#int64) | repeated | | - - - - - - - - -### ListGroupReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| group | [Group](#api-v1-Group) | repeated | | -| total | [int64](#int64) | | | - - - - - - - - -### ListGroupRequest -查询用户组列表。不需要分页,直接返回全部用户组,只是可以指定查询哪些字段 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| wd | [string](#string) | | | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| sort | [string](#string) | | | -| field | [string](#string) | repeated | | - - - - - - - - -### UpdateGroupPermissionRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| group_id | [int64](#int64) | | | -| permission_id | [int64](#int64) | repeated | | - - - - - - - - - - - - - - -### GroupAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateGroup | [Group](#api-v1-Group) | [Group](#api-v1-Group) | 创建用户组 | -| UpdateGroup | [Group](#api-v1-Group) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户组 | -| DeleteGroup | [DeleteGroupRequest](#api-v1-DeleteGroupRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除用户组 | -| GetGroup | [GetGroupRequest](#api-v1-GetGroupRequest) | [Group](#api-v1-Group) | 获取用户组列表 | -| ListGroup | [ListGroupRequest](#api-v1-ListGroupRequest) | [ListGroupReply](#api-v1-ListGroupReply) | | -| GetGroupPermission | [GetGroupPermissionRequest](#api-v1-GetGroupPermissionRequest) | [GroupPermissions](#api-v1-GroupPermissions) | 获取用户组权限列表 | -| UpdateGroupPermission | [UpdateGroupPermissionRequest](#api-v1-UpdateGroupPermissionRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户组权限,给用户组设置权限 | - - - - - - -

Top

- -## api/v1/health.proto - - - - - -### PingRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | - - - - - - - - -### PongReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - - - - - - - -### HealthAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Health | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| Ping | [.PingRequest](#PingRequest) | [.PongReply](#PongReply) | | - - - - - - -

Top

- -## api/v1/permission.proto - - - - - -### DeletePermissionRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### GetPermissionReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| permission | [Permission](#api-v1-Permission) | | | - - - - - - - - -### GetPermissionRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### ListPermissionReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| permission | [Permission](#api-v1-Permission) | repeated | | - - - - - - - - -### ListPermissionRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| wd | [string](#string) | | | -| method | [string](#string) | repeated | | -| path | [string](#string) | | | - - - - - - - - -### Permission - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| method | [string](#string) | | | -| path | [string](#string) | | | -| title | [string](#string) | | | -| description | [string](#string) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - - - - - - - -### PermissionAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| UpdatePermission | [Permission](#api-v1-Permission) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| GetPermission | [GetPermissionRequest](#api-v1-GetPermissionRequest) | [Permission](#api-v1-Permission) | | -| ListPermission | [ListPermissionRequest](#api-v1-ListPermissionRequest) | [ListPermissionReply](#api-v1-ListPermissionReply) | | - - - - - - -

Top

- -## api/v1/report.proto - - - - - -### DeleteReportRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### ListReportReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| report | [Report](#api-v1-Report) | repeated | | - - - - - - - - -### ListReportRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| wd | [string](#string) | | | -| field | [string](#string) | repeated | | -| order | [string](#string) | | | -| status | [bool](#bool) | repeated | | - - - - - - - - -### Report -这里是proto文件中的结构体,可以根据需要删除或者调整 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| document_id | [int64](#int64) | | | -| user_id | [int64](#int64) | | | -| reason | [int32](#int32) | | | -| status | [bool](#bool) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| document_title | [string](#string) | | | -| remark | [string](#string) | | | -| username | [string](#string) | | | - - - - - - - - - - - - - - -### ReportAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| CreateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| UpdateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| DeleteReport | [DeleteReportRequest](#api-v1-DeleteReportRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| ListReport | [ListReportRequest](#api-v1-ListReportRequest) | [ListReportReply](#api-v1-ListReportReply) | | - - - - - - -

Top

- -## api/v1/user.proto - - - - - -### DeleteUserRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | repeated | | - - - - - - - - -### Dynamic - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| user_id | [int64](#int64) | | | -| content | [string](#string) | | | -| type | [int32](#int32) | | 类型 | -| username | [string](#string) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### FindPasswordRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| email | [string](#string) | | | -| token | [string](#string) | | | -| password | [string](#string) | | | -| captcha | [string](#string) | | | -| captcha_id | [string](#string) | | | - - - - - - - - -### GetUserCaptchaReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| enable | [bool](#bool) | | | -| id | [string](#string) | | | -| captcha | [string](#string) | | | -| type | [string](#string) | | | - - - - - - - - -### GetUserCaptchaRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| type | [string](#string) | | 验证码类型:register、login、comment、find_password、upload | - - - - - - - - -### GetUserPermissionsReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| permission | [Permission](#api-v1-Permission) | repeated | | - - - - - - - - -### GetUserRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | - - - - - - - - -### ListUserDynamicReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| dynamic | [Dynamic](#api-v1-Dynamic) | repeated | | - - - - - - - - -### ListUserDynamicRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| id | [int64](#int64) | | | - - - - - - - - -### ListUserReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| total | [int64](#int64) | | | -| user | [User](#api-v1-User) | repeated | | - - - - - - - - -### ListUserRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| page | [int64](#int64) | | | -| size | [int64](#int64) | | | -| wd | [string](#string) | | | -| sort | [string](#string) | | | -| id | [int64](#int64) | repeated | | -| group_id | [int64](#int64) | repeated | | -| status | [int32](#int32) | repeated | | -| limit | [int64](#int64) | | | - - - - - - - - -### LoginReply - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| token | [string](#string) | | | -| user | [User](#api-v1-User) | | | - - - - - - - - -### RegisterAndLoginRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| username | [string](#string) | | | -| password | [string](#string) | | | -| captcha | [string](#string) | | | -| captcha_id | [string](#string) | | | -| email | [string](#string) | | | - - - - - - - - -### SetUserRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| username | [string](#string) | | | -| password | [string](#string) | | | -| group_id | [int64](#int64) | repeated | | - - - - - - - - -### Sign - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| user_id | [int64](#int64) | | | -| sign_at | [int32](#int32) | | | -| ip | [string](#string) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| award | [int32](#int32) | | 签到积分奖励 | - - - - - - - - -### UpdateUserPasswordRequest -修改用户密码 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int64](#int64) | | | -| old_password | [string](#string) | | | -| new_password | [string](#string) | | | - - - - - - - - -### User - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| login_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| id | [int64](#int64) | | | -| username | [string](#string) | | | -| mobile | [string](#string) | | | -| email | [string](#string) | | | -| address | [string](#string) | | | -| signature | [string](#string) | | | -| last_login_ip | [string](#string) | | | -| register_ip | [string](#string) | | | -| doc_count | [int32](#int32) | | | -| follow_count | [int32](#int32) | | | -| fans_count | [int32](#int32) | | | -| favorite_count | [int32](#int32) | | | -| comment_count | [int32](#int32) | | | -| status | [int32](#int32) | | | -| avatar | [string](#string) | | | -| identity | [string](#string) | | | -| realname | [string](#string) | | | -| group_id | [int64](#int64) | repeated | | -| credit_count | [int32](#int32) | | | - - - - - - - - - - - - - - -### UserAPI - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Register | [RegisterAndLoginRequest](#api-v1-RegisterAndLoginRequest) | [LoginReply](#api-v1-LoginReply) | 用户注册 | -| Login | [RegisterAndLoginRequest](#api-v1-RegisterAndLoginRequest) | [LoginReply](#api-v1-LoginReply) | 用户登录 | -| Logout | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 退出登录 | -| GetUser | [GetUserRequest](#api-v1-GetUserRequest) | [User](#api-v1-User) | 查询用户信息。如果传递了Id参数,则表示查询用户的公开信息,否则查询当前用户的私有信息 | -| UpdateUserPassword | [UpdateUserPasswordRequest](#api-v1-UpdateUserPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 | -| UpdateUserProfile | [User](#api-v1-User) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 | -| DeleteUser | [DeleteUserRequest](#api-v1-DeleteUserRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除用户。需要验证用户权限 | -| AddUser | [SetUserRequest](#api-v1-SetUserRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 新增用户 | -| SetUser | [SetUserRequest](#api-v1-SetUserRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 设置用户 | -| ListUser | [ListUserRequest](#api-v1-ListUserRequest) | [ListUserReply](#api-v1-ListUserReply) | 查询用户列表。对于非管理员,返回相应用户的公开信息; 对于管理员,返回相应用户的绝大部分信息 | -| GetUserCaptcha | [GetUserCaptchaRequest](#api-v1-GetUserCaptchaRequest) | [GetUserCaptchaReply](#api-v1-GetUserCaptchaReply) | GetUserCaptcha 获取用户验证码 | -| GetUserPermissions | [.google.protobuf.Empty](#google-protobuf-Empty) | [GetUserPermissionsReply](#api-v1-GetUserPermissionsReply) | GetUserCaptcha 获取用户验证码 | -| CanIUploadDocument | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 用户是否可以上传文档 | -| ListUserDynamic | [ListUserDynamicRequest](#api-v1-ListUserDynamicRequest) | [ListUserDynamicReply](#api-v1-ListUserDynamicReply) | 获取用户动态,包括获取关注的用户的动态 | -| SignToday | [.google.protobuf.Empty](#google-protobuf-Empty) | [Sign](#api-v1-Sign) | 每日签到 | -| GetSignedToday | [.google.protobuf.Empty](#google-protobuf-Empty) | [Sign](#api-v1-Sign) | 获取今日已签到记录 | -| FindPasswordStepOne | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | -| FindPasswordStepTwo | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | -| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | -| double | | double | double | float | float64 | double | float | Float | -| float | | float | float | float | float32 | float | float | Float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | -| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - diff --git a/docs/api/article.md b/docs/api/article.md new file mode 100644 index 0000000..7206c6c --- /dev/null +++ b/docs/api/article.md @@ -0,0 +1,158 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/article.proto](#api_v1_article-proto) + - [Article](#api-v1-Article) + - [DeleteArticleRequest](#api-v1-DeleteArticleRequest) + - [GetArticleRequest](#api-v1-GetArticleRequest) + - [ListArticleReply](#api-v1-ListArticleReply) + - [ListArticleRequest](#api-v1-ListArticleRequest) + + - [ArticleAPI](#api-v1-ArticleAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/article.proto + + + + + +### Article +文章 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | 文章ID | +| identifier | [string](#string) | | 文章唯一标识 | +| author | [string](#string) | | 文章作者。如果为空,则使用网站名称作为作者 | +| view_count | [int64](#int64) | | 文章浏览次数 | +| title | [string](#string) | | 文章标题 | +| keywords | [string](#string) | | 文章关键字 | +| description | [string](#string) | | 文章描述 | +| content | [string](#string) | | 文章内容 | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 文章创建时间 | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 文章更新时间 | + + + + + + + + +### DeleteArticleRequest +删除文章请求,传入单个或者多个文章ID + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### GetArticleRequest +根据ID或者文章标识获取文章,二选一 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | 文章ID | +| identifier | [string](#string) | | 文章唯一标识 | + + + + + + + + +### ListArticleReply +文章列表响应 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | 文章总数 | +| article | [Article](#api-v1-Article) | repeated | 文章列表 | + + + + + + + + +### ListArticleRequest +文章列表请求 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | 页码 | +| size | [int64](#int64) | | 每页数量 | +| wd | [string](#string) | | 搜索关键字 | +| field | [string](#string) | repeated | 查询字段 | +| order | [string](#string) | | 排序字段,根据指定的字段倒序排序 | + + + + + + + + + + + + + + +### ArticleAPI +文章API服务 + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateArticle | [Article](#api-v1-Article) | [.google.protobuf.Empty](#google-protobuf-Empty) | 创建文章 | +| UpdateArticle | [Article](#api-v1-Article) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新文章 | +| DeleteArticle | [DeleteArticleRequest](#api-v1-DeleteArticleRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除文章 | +| GetArticle | [GetArticleRequest](#api-v1-GetArticleRequest) | [Article](#api-v1-Article) | 获取文章 | +| ListArticle | [ListArticleRequest](#api-v1-ListArticleRequest) | [ListArticleReply](#api-v1-ListArticleReply) | 文章列表 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/attachment.md b/docs/api/attachment.md new file mode 100644 index 0000000..39c5d3e --- /dev/null +++ b/docs/api/attachment.md @@ -0,0 +1,168 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/attachment.proto](#api_v1_attachment-proto) + - [Attachment](#api-v1-Attachment) + - [DeleteAttachmentRequest](#api-v1-DeleteAttachmentRequest) + - [GetAttachmentRequest](#api-v1-GetAttachmentRequest) + - [ListAttachmentReply](#api-v1-ListAttachmentReply) + - [ListAttachmentRequest](#api-v1-ListAttachmentRequest) + + - [AttachmentAPI](#api-v1-AttachmentAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/attachment.proto + + + + + +### Attachment +附件 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | 附件ID | +| hash | [string](#string) | | 附件哈希值,MD5 | +| user_id | [int64](#int64) | | 上传用户ID | +| type_id | [int64](#int64) | | 附件类型ID,如果是文档类型,则为文档ID | +| type | [int32](#int32) | | 附件类型,0: 未知,1: 头像,2: 文档,3: 文章,4: 评论,5: | +| enable | [bool](#bool) | | 横幅,6: 分类封面,7: 配置 + +是否启用 | +| path | [string](#string) | | 附件路径 | +| name | [string](#string) | | 附件名称 | +| size | [int64](#int64) | | 附件大小,单位:字节 | +| width | [int64](#int64) | | 附件宽度,单位:像素。针对图片附件 | +| height | [int64](#int64) | | 附件高度,单位:像素。针对图片附件 | +| ext | [string](#string) | | 扩展名,如:.docx | +| ip | [string](#string) | | 上传IP地址 | +| username | [string](#string) | | 用户名称 | +| type_name | [string](#string) | | 附件类型名称 | +| description | [string](#string) | | 附件描述、备注 | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 | + + + + + + + + +### DeleteAttachmentRequest +删除附件请求 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### GetAttachmentRequest +获取附件请求 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### ListAttachmentReply +列出附件响应 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| attachment | [Attachment](#api-v1-Attachment) | repeated | | + + + + + + + + +### ListAttachmentRequest +列出附件请求 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | 页码 | +| size | [int64](#int64) | | 每页数量 | +| wd | [string](#string) | | 搜索关键字 | +| enable | [bool](#bool) | repeated | 是否启用 | +| user_id | [int64](#int64) | repeated | 用户ID | +| type | [int64](#int64) | repeated | 类型 | +| ext | [string](#string) | | 扩展名 | + + + + + + + + + + + + + + +### AttachmentAPI +附件服务。只有管理员才有权限操作 + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| UpdateAttachment | [Attachment](#api-v1-Attachment) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新附件 | +| DeleteAttachment | [DeleteAttachmentRequest](#api-v1-DeleteAttachmentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除附件。这里只是软删除,不会真正删除附件,默认24小时候会真正清除附件 | +| GetAttachment | [GetAttachmentRequest](#api-v1-GetAttachmentRequest) | [Attachment](#api-v1-Attachment) | 查询附件 | +| ListAttachment | [ListAttachmentRequest](#api-v1-ListAttachmentRequest) | [ListAttachmentReply](#api-v1-ListAttachmentReply) | 列出附件 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/banner.md b/docs/api/banner.md new file mode 100644 index 0000000..27c3975 --- /dev/null +++ b/docs/api/banner.md @@ -0,0 +1,158 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/banner.proto](#api_v1_banner-proto) + - [Banner](#api-v1-Banner) + - [DeleteBannerRequest](#api-v1-DeleteBannerRequest) + - [GetBannerRequest](#api-v1-GetBannerRequest) + - [ListBannerReply](#api-v1-ListBannerReply) + - [ListBannerRequest](#api-v1-ListBannerRequest) + + - [BannerAPI](#api-v1-BannerAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/banner.proto + + + + + +### Banner +banner,轮播图 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | 主键 | +| title | [string](#string) | | 标题,名称 | +| path | [string](#string) | | 图片地址 | +| sort | [int32](#int32) | | 排序,值越大越靠前 | +| enable | [bool](#bool) | | 是否启用 | +| type | [int32](#int32) | | 类型,如PC横幅、小程序横幅等,见 web/utils/enum.js 中的枚举 | +| url | [string](#string) | | 跳转地址 | +| description | [string](#string) | | 描述 | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 | + + + + + + + + +### DeleteBannerRequest +删除横幅 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### GetBannerRequest +获取横幅 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### ListBannerReply +横幅列表 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | 总数 | +| banner | [Banner](#api-v1-Banner) | repeated | 横幅数组 | + + + + + + + + +### ListBannerRequest +横幅列表请求 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | 页码 | +| size | [int64](#int64) | | 每页数量 | +| type | [int32](#int32) | repeated | 类型 | +| enable | [bool](#bool) | repeated | 是否启用 | +| wd | [string](#string) | | 搜索关键字 | +| field | [string](#string) | repeated | 查询字段,不指定,则查询全部 | + + + + + + + + + + + + + + +### BannerAPI +横幅API服务 + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateBanner | [Banner](#api-v1-Banner) | [Banner](#api-v1-Banner) | 创建横幅 | +| UpdateBanner | [Banner](#api-v1-Banner) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新横幅 | +| DeleteBanner | [DeleteBannerRequest](#api-v1-DeleteBannerRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除横幅 | +| GetBanner | [GetBannerRequest](#api-v1-GetBannerRequest) | [Banner](#api-v1-Banner) | 查询横幅 | +| ListBanner | [ListBannerRequest](#api-v1-ListBannerRequest) | [ListBannerReply](#api-v1-ListBannerReply) | 横幅列表 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/category.md b/docs/api/category.md new file mode 100644 index 0000000..410877a --- /dev/null +++ b/docs/api/category.md @@ -0,0 +1,157 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/category.proto](#api_v1_category-proto) + - [Category](#api-v1-Category) + - [DeleteCategoryRequest](#api-v1-DeleteCategoryRequest) + - [GetCategoryRequest](#api-v1-GetCategoryRequest) + - [ListCategoryReply](#api-v1-ListCategoryReply) + - [ListCategoryRequest](#api-v1-ListCategoryRequest) + + - [CategoryAPI](#api-v1-CategoryAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/category.proto + + + + + +### Category + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int32](#int32) | | | +| parent_id | [int32](#int32) | | | +| title | [string](#string) | | | +| doc_count | [int32](#int32) | | | +| sort | [int32](#int32) | | | +| enable | [bool](#bool) | | | +| cover | [string](#string) | | 分类封面 | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### DeleteCategoryRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### GetCategoryRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### ListCategoryReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| category | [Category](#api-v1-Category) | repeated | | + + + + + + + + +### ListCategoryRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| parent_id | [int64](#int64) | repeated | | +| wd | [string](#string) | | | +| enable | [bool](#bool) | repeated | | +| field | [string](#string) | repeated | | + + + + + + + + + + + + + + +### CategoryAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| UpdateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| DeleteCategory | [DeleteCategoryRequest](#api-v1-DeleteCategoryRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| GetCategory | [GetCategoryRequest](#api-v1-GetCategoryRequest) | [Category](#api-v1-Category) | | +| ListCategory | [ListCategoryRequest](#api-v1-ListCategoryRequest) | [ListCategoryReply](#api-v1-ListCategoryReply) | | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/comment.md b/docs/api/comment.md new file mode 100644 index 0000000..92de454 --- /dev/null +++ b/docs/api/comment.md @@ -0,0 +1,201 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/comment.proto](#api_v1_comment-proto) + - [CheckCommentRequest](#api-v1-CheckCommentRequest) + - [Comment](#api-v1-Comment) + - [CreateCommentRequest](#api-v1-CreateCommentRequest) + - [DeleteCommentRequest](#api-v1-DeleteCommentRequest) + - [GetCommentRequest](#api-v1-GetCommentRequest) + - [ListCommentReply](#api-v1-ListCommentReply) + - [ListCommentRequest](#api-v1-ListCommentRequest) + + - [CommentAPI](#api-v1-CommentAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/comment.proto + + + + + +### CheckCommentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | +| status | [int32](#int32) | | | + + + + + + + + +### Comment + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| id | [int64](#int64) | | | +| parent_id | [int64](#int64) | | | +| content | [string](#string) | | | +| document_id | [int64](#int64) | | | +| status | [int32](#int32) | | | +| comment_count | [int32](#int32) | | | +| user_id | [int64](#int64) | | | +| user | [User](#api-v1-User) | | | +| document_title | [string](#string) | | | + + + + + + + + +### CreateCommentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| document_id | [int64](#int64) | | | +| parent_id | [int64](#int64) | | | +| content | [string](#string) | | | +| captcha_id | [string](#string) | | | +| captcha | [string](#string) | | | + + + + + + + + +### DeleteCommentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### GetCommentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### ListCommentReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| comment | [Comment](#api-v1-Comment) | repeated | | + + + + + + + + +### ListCommentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| wd | [string](#string) | | | +| field | [string](#string) | repeated | | +| order | [string](#string) | | | +| status | [int32](#int32) | repeated | | +| document_id | [int64](#int64) | | | +| user_id | [int64](#int64) | | | +| parent_id | [int64](#int64) | repeated | | +| with_document_title | [bool](#bool) | | | + + + + + + + + + + + + + + +### CommentAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateComment | [CreateCommentRequest](#api-v1-CreateCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| UpdateComment | [Comment](#api-v1-Comment) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新评论,仅限管理员操作 | +| DeleteComment | [DeleteCommentRequest](#api-v1-DeleteCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 管理员或用户自己删除自己的评论 | +| GetComment | [GetCommentRequest](#api-v1-GetCommentRequest) | [Comment](#api-v1-Comment) | 获取单个评论 | +| ListComment | [ListCommentRequest](#api-v1-ListCommentRequest) | [ListCommentReply](#api-v1-ListCommentReply) | 获取评论列表 | +| CheckComment | [CheckCommentRequest](#api-v1-CheckCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 审核评论 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/config.md b/docs/api/config.md new file mode 100644 index 0000000..43f2f01 --- /dev/null +++ b/docs/api/config.md @@ -0,0 +1,299 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/config.proto](#api_v1_config-proto) + - [Config](#api-v1-Config) + - [ConfigCaptcha](#api-v1-ConfigCaptcha) + - [ConfigFooter](#api-v1-ConfigFooter) + - [ConfigSecurity](#api-v1-ConfigSecurity) + - [ConfigSystem](#api-v1-ConfigSystem) + - [Configs](#api-v1-Configs) + - [EnvDependent](#api-v1-EnvDependent) + - [Envs](#api-v1-Envs) + - [ListConfigRequest](#api-v1-ListConfigRequest) + - [Settings](#api-v1-Settings) + - [Stats](#api-v1-Stats) + + - [ConfigAPI](#api-v1-ConfigAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/config.proto + + + + + +### Config + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| label | [string](#string) | | | +| name | [string](#string) | | | +| value | [string](#string) | | | +| placeholder | [string](#string) | | | +| input_type | [string](#string) | | | +| category | [string](#string) | | | +| sort | [int32](#int32) | | | +| options | [string](#string) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### ConfigCaptcha +验证码配置 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| length | [int32](#int32) | | | +| width | [int32](#int32) | | | +| height | [int32](#int32) | | | +| type | [string](#string) | | | + + + + + + + + +### ConfigFooter +底链配置项 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| about | [string](#string) | | | +| contact | [string](#string) | | | +| agreement | [string](#string) | | | +| copyright | [string](#string) | | | +| feedback | [string](#string) | | | + + + + + + + + +### ConfigSecurity +安全配置 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| is_close | [bool](#bool) | | | +| close_statement | [string](#string) | | | +| enable_register | [bool](#bool) | | | +| enable_captcha_login | [bool](#bool) | | | +| enable_captcha_register | [bool](#bool) | | | +| enable_captcha_comment | [bool](#bool) | | | +| enable_captcha_find_password | [bool](#bool) | | | +| enable_captcha_upload | [bool](#bool) | | | +| max_document_size | [int32](#int32) | | | +| document_allowed_ext | [string](#string) | repeated | | +| login_required | [bool](#bool) | | 是否登录才能访问 | + + + + + + + + +### ConfigSystem +系统配置项 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| domain | [string](#string) | | | +| title | [string](#string) | | | +| keywords | [string](#string) | | | +| description | [string](#string) | | | +| logo | [string](#string) | | | +| favicon | [string](#string) | | | +| icp | [string](#string) | | | +| analytics | [string](#string) | | | +| sitename | [string](#string) | | | +| copyright_start_year | [string](#string) | | | +| register_background | [string](#string) | | | +| login_background | [string](#string) | | | +| recommend_words | [string](#string) | repeated | | +| version | [string](#string) | | 程序版本号 | + + + + + + + + +### Configs + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| config | [Config](#api-v1-Config) | repeated | | + + + + + + + + +### EnvDependent + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | 依赖名称 | +| description | [string](#string) | | 依赖描述 | +| is_installed | [bool](#bool) | | 是否已安装 | +| error | [string](#string) | | 错误信息 | +| checked_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 检测时间 | +| cmd | [string](#string) | | 检测命令 | +| is_required | [bool](#bool) | | 是否必须 | + + + + + + + + +### Envs + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| envs | [EnvDependent](#api-v1-EnvDependent) | repeated | | + + + + + + + + +### ListConfigRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| category | [string](#string) | repeated | | + + + + + + + + +### Settings + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| system | [ConfigSystem](#api-v1-ConfigSystem) | | | +| footer | [ConfigFooter](#api-v1-ConfigFooter) | | | +| security | [ConfigSecurity](#api-v1-ConfigSecurity) | | ConfigCaptcha captcha = 4; | + + + + + + + + +### Stats + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| user_count | [int64](#int64) | | | +| document_count | [int64](#int64) | | | +| category_count | [int64](#int64) | | | +| article_count | [int64](#int64) | | | +| comment_count | [int64](#int64) | | | +| banner_count | [int64](#int64) | | | +| friendlink_count | [int64](#int64) | | | +| os | [string](#string) | | | +| version | [string](#string) | | | +| hash | [string](#string) | | | +| build_at | [string](#string) | | | +| report_count | [int64](#int64) | | | + + + + + + + + + + + + + + +### ConfigAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| GetSettings | [.google.protobuf.Empty](#google-protobuf-Empty) | [Settings](#api-v1-Settings) | 获取系统配置(针对所有用户,只读) | +| UpdateConfig | [Configs](#api-v1-Configs) | [.google.protobuf.Empty](#google-protobuf-Empty) | UpdateConfig 更新配置 | +| ListConfig | [ListConfigRequest](#api-v1-ListConfigRequest) | [Configs](#api-v1-Configs) | ListConfig 查询配置项 | +| GetStats | [.google.protobuf.Empty](#google-protobuf-Empty) | [Stats](#api-v1-Stats) | 获取系统配置 | +| GetEnvs | [.google.protobuf.Empty](#google-protobuf-Empty) | [Envs](#api-v1-Envs) | 获取系统环境依赖检测 | +| UpdateSitemap | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新站点地图 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/document.md b/docs/api/document.md new file mode 100644 index 0000000..d637100 --- /dev/null +++ b/docs/api/document.md @@ -0,0 +1,404 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/document.proto](#api_v1_document-proto) + - [CreateDocumentItem](#api-v1-CreateDocumentItem) + - [CreateDocumentRequest](#api-v1-CreateDocumentRequest) + - [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) + - [Document](#api-v1-Document) + - [DocumentScore](#api-v1-DocumentScore) + - [DownloadDocumentReply](#api-v1-DownloadDocumentReply) + - [GetDocumentRequest](#api-v1-GetDocumentRequest) + - [ListDocumentForHomeItem](#api-v1-ListDocumentForHomeItem) + - [ListDocumentForHomeRequest](#api-v1-ListDocumentForHomeRequest) + - [ListDocumentForHomeResponse](#api-v1-ListDocumentForHomeResponse) + - [ListDocumentReply](#api-v1-ListDocumentReply) + - [ListDocumentRequest](#api-v1-ListDocumentRequest) + - [RecoverRecycleDocumentRequest](#api-v1-RecoverRecycleDocumentRequest) + - [SearchDocumentReply](#api-v1-SearchDocumentReply) + - [SearchDocumentRequest](#api-v1-SearchDocumentRequest) + - [SetDocumentRecommendRequest](#api-v1-SetDocumentRecommendRequest) + + - [DocumentAPI](#api-v1-DocumentAPI) + - [RecycleAPI](#api-v1-RecycleAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/document.proto + + + + + +### CreateDocumentItem + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| title | [string](#string) | | | +| attachment_id | [int64](#int64) | | | +| price | [int32](#int32) | | | + + + + + + + + +### CreateDocumentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| overwrite | [bool](#bool) | | | +| category_id | [int64](#int64) | repeated | | +| document | [CreateDocumentItem](#api-v1-CreateDocumentItem) | repeated | | + + + + + + + + +### DeleteDocumentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### Document + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| title | [string](#string) | | | +| keywords | [string](#string) | | | +| description | [string](#string) | | | +| user_id | [int64](#int64) | | | +| cover | [string](#string) | | | +| width | [int32](#int32) | | | +| height | [int32](#int32) | | | +| preview | [int32](#int32) | | | +| pages | [int32](#int32) | | | +| uuid | [string](#string) | | | +| download_count | [int32](#int32) | | | +| view_count | [int32](#int32) | | | +| favorite_count | [int32](#int32) | | | +| comment_count | [int32](#int32) | | | +| score | [int32](#int32) | | | +| score_count | [int32](#int32) | | | +| price | [int32](#int32) | | | +| size | [int64](#int64) | | | +| status | [int32](#int32) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| deleted_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| recommend_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| deleted_user_id | [int64](#int64) | | | +| username | [string](#string) | | | +| category_id | [int64](#int64) | repeated | | +| deleted_username | [string](#string) | | | +| ext | [string](#string) | | | +| attachment | [Attachment](#api-v1-Attachment) | | | +| user | [User](#api-v1-User) | | | +| enable_gzip | [bool](#bool) | | | +| convert_error | [string](#string) | | | + + + + + + + + +### DocumentScore + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| document_id | [int64](#int64) | | | +| user_id | [int64](#int64) | | | +| score | [int32](#int32) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### DownloadDocumentReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| url | [string](#string) | | | + + + + + + + + +### GetDocumentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| with_author | [bool](#bool) | | | + + + + + + + + +### ListDocumentForHomeItem + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| category_id | [int64](#int64) | | | +| category_cover | [string](#string) | | | +| category_name | [string](#string) | | | +| document | [Document](#api-v1-Document) | repeated | | + + + + + + + + +### ListDocumentForHomeRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| limit | [int64](#int64) | | | + + + + + + + + +### ListDocumentForHomeResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| document | [ListDocumentForHomeItem](#api-v1-ListDocumentForHomeItem) | repeated | | + + + + + + + + +### ListDocumentReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| document | [Document](#api-v1-Document) | repeated | | + + + + + + + + +### ListDocumentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| wd | [string](#string) | | | +| field | [string](#string) | repeated | | +| order | [string](#string) | | | +| category_id | [int64](#int64) | repeated | | +| user_id | [int64](#int64) | repeated | | +| status | [int32](#int32) | repeated | | +| is_recommend | [bool](#bool) | repeated | | +| limit | [int64](#int64) | | | + + + + + + + + +### RecoverRecycleDocumentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### SearchDocumentReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| spend | [string](#string) | | 搜索耗时 | +| document | [Document](#api-v1-Document) | repeated | | + + + + + + + + +### SearchDocumentRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int32](#int32) | | | +| size | [int32](#int32) | | | +| wd | [string](#string) | | | +| category_id | [int64](#int64) | repeated | 分类 | +| sort | [string](#string) | | 排序 | +| ext | [string](#string) | | 类型 | + + + + + + + + +### SetDocumentRecommendRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | +| type | [int32](#int32) | | 0, 取消推荐,1:推荐 2:重新推荐 | + + + + + + + + + + + + + + +### DocumentAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| ListDocumentForHome | [ListDocumentForHomeRequest](#api-v1-ListDocumentForHomeRequest) | [ListDocumentForHomeResponse](#api-v1-ListDocumentForHomeResponse) | | +| SetDocumentRecommend | [SetDocumentRecommendRequest](#api-v1-SetDocumentRecommendRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| CreateDocument | [CreateDocumentRequest](#api-v1-CreateDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| UpdateDocument | [Document](#api-v1-Document) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| DeleteDocument | [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| GetDocument | [GetDocumentRequest](#api-v1-GetDocumentRequest) | [Document](#api-v1-Document) | | +| GetRelatedDocuments | [Document](#api-v1-Document) | [ListDocumentReply](#api-v1-ListDocumentReply) | | +| DownloadDocument | [Document](#api-v1-Document) | [DownloadDocumentReply](#api-v1-DownloadDocumentReply) | | +| ListDocument | [ListDocumentRequest](#api-v1-ListDocumentRequest) | [ListDocumentReply](#api-v1-ListDocumentReply) | | +| SearchDocument | [SearchDocumentRequest](#api-v1-SearchDocumentRequest) | [SearchDocumentReply](#api-v1-SearchDocumentReply) | | +| SetDocumentScore | [DocumentScore](#api-v1-DocumentScore) | [.google.protobuf.Empty](#google-protobuf-Empty) | 设置文档评分 | +| GetDocumentScore | [DocumentScore](#api-v1-DocumentScore) | [DocumentScore](#api-v1-DocumentScore) | 获取当前登录用户的文档评分 | +| SetDocumentReconvert | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 将文档一键设置为重转 | + + + + +### RecycleAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| ListRecycleDocument | [ListDocumentRequest](#api-v1-ListDocumentRequest) | [ListDocumentReply](#api-v1-ListDocumentReply) | 文档回收站列表 | +| RecoverRecycleDocument | [RecoverRecycleDocumentRequest](#api-v1-RecoverRecycleDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 恢复回收站文档,支持恢复单个文档或者是批量恢复 | +| DeleteRecycleDocument | [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除回收站文档 | +| ClearRecycleDocument | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 清空回收站文档 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/favorite.md b/docs/api/favorite.md new file mode 100644 index 0000000..77cf632 --- /dev/null +++ b/docs/api/favorite.md @@ -0,0 +1,154 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/favorite.proto](#api_v1_favorite-proto) + - [DeleteFavoriteRequest](#api-v1-DeleteFavoriteRequest) + - [Favorite](#api-v1-Favorite) + - [GetFavoriteRequest](#api-v1-GetFavoriteRequest) + - [ListFavoriteReply](#api-v1-ListFavoriteReply) + - [ListFavoriteRequest](#api-v1-ListFavoriteRequest) + + - [FavoriteAPI](#api-v1-FavoriteAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/favorite.proto + + + + + +### DeleteFavoriteRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### Favorite + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| user_id | [int64](#int64) | | | +| document_id | [int64](#int64) | | | +| title | [string](#string) | | | +| ext | [string](#string) | | | +| score | [int32](#int32) | | | +| size | [int64](#int64) | | | +| pages | [int32](#int32) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### GetFavoriteRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| document_id | [int64](#int64) | | | + + + + + + + + +### ListFavoriteReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| favorite | [Favorite](#api-v1-Favorite) | repeated | | + + + + + + + + +### ListFavoriteRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| user_id | [int64](#int64) | | | + + + + + + + + + + + + + + +### FavoriteAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateFavorite | [Favorite](#api-v1-Favorite) | [Favorite](#api-v1-Favorite) | 添加收藏 | +| DeleteFavorite | [DeleteFavoriteRequest](#api-v1-DeleteFavoriteRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 取消收藏 | +| GetFavorite | [GetFavoriteRequest](#api-v1-GetFavoriteRequest) | [Favorite](#api-v1-Favorite) | 根据文章id,查询用户是否有收藏某篇文档 | +| ListFavorite | [ListFavoriteRequest](#api-v1-ListFavoriteRequest) | [ListFavoriteReply](#api-v1-ListFavoriteReply) | 查询用户的收藏 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/friendlink.md b/docs/api/friendlink.md new file mode 100644 index 0000000..c3e57c1 --- /dev/null +++ b/docs/api/friendlink.md @@ -0,0 +1,155 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/friendlink.proto](#api_v1_friendlink-proto) + - [DeleteFriendlinkRequest](#api-v1-DeleteFriendlinkRequest) + - [Friendlink](#api-v1-Friendlink) + - [GetFriendlinkRequest](#api-v1-GetFriendlinkRequest) + - [ListFriendlinkReply](#api-v1-ListFriendlinkReply) + - [ListFriendlinkRequest](#api-v1-ListFriendlinkRequest) + + - [FriendlinkAPI](#api-v1-FriendlinkAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/friendlink.proto + + + + + +### DeleteFriendlinkRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### Friendlink + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int32](#int32) | | | +| title | [string](#string) | | | +| link | [string](#string) | | | +| description | [string](#string) | | | +| sort | [int32](#int32) | | | +| enable | [bool](#bool) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### GetFriendlinkRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### ListFriendlinkReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| friendlink | [Friendlink](#api-v1-Friendlink) | repeated | | +| total | [int64](#int64) | | | + + + + + + + + +### ListFriendlinkRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int32](#int32) | | | +| size | [int32](#int32) | | | +| wd | [string](#string) | | | +| enable | [bool](#bool) | repeated | | +| field | [string](#string) | repeated | | + + + + + + + + + + + + + + +### FriendlinkAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateFriendlink | [Friendlink](#api-v1-Friendlink) | [Friendlink](#api-v1-Friendlink) | | +| UpdateFriendlink | [Friendlink](#api-v1-Friendlink) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| DeleteFriendlink | [DeleteFriendlinkRequest](#api-v1-DeleteFriendlinkRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| GetFriendlink | [GetFriendlinkRequest](#api-v1-GetFriendlinkRequest) | [Friendlink](#api-v1-Friendlink) | | +| ListFriendlink | [ListFriendlinkRequest](#api-v1-ListFriendlinkRequest) | [ListFriendlinkReply](#api-v1-ListFriendlinkReply) | | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/group.md b/docs/api/group.md new file mode 100644 index 0000000..1bb517a --- /dev/null +++ b/docs/api/group.md @@ -0,0 +1,211 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/group.proto](#api_v1_group-proto) + - [DeleteGroupRequest](#api-v1-DeleteGroupRequest) + - [GetGroupPermissionRequest](#api-v1-GetGroupPermissionRequest) + - [GetGroupRequest](#api-v1-GetGroupRequest) + - [Group](#api-v1-Group) + - [GroupPermissions](#api-v1-GroupPermissions) + - [ListGroupReply](#api-v1-ListGroupReply) + - [ListGroupRequest](#api-v1-ListGroupRequest) + - [UpdateGroupPermissionRequest](#api-v1-UpdateGroupPermissionRequest) + + - [GroupAPI](#api-v1-GroupAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/group.proto + + + + + +### DeleteGroupRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### GetGroupPermissionRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### GetGroupRequest +根据组名或者ID获取用户组 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| title | [string](#string) | | | + + + + + + + + +### Group + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| title | [string](#string) | | | +| color | [string](#string) | | | +| is_default | [bool](#bool) | | | +| is_display | [bool](#bool) | | | +| description | [string](#string) | | | +| user_count | [int32](#int32) | | | +| sort | [int32](#int32) | | | +| enable_upload | [bool](#bool) | | | +| enable_comment_approval | [bool](#bool) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### GroupPermissions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| permission_id | [int64](#int64) | repeated | | + + + + + + + + +### ListGroupReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| group | [Group](#api-v1-Group) | repeated | | +| total | [int64](#int64) | | | + + + + + + + + +### ListGroupRequest +查询用户组列表。不需要分页,直接返回全部用户组,只是可以指定查询哪些字段 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| wd | [string](#string) | | | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| sort | [string](#string) | | | +| field | [string](#string) | repeated | | + + + + + + + + +### UpdateGroupPermissionRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| group_id | [int64](#int64) | | | +| permission_id | [int64](#int64) | repeated | | + + + + + + + + + + + + + + +### GroupAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateGroup | [Group](#api-v1-Group) | [Group](#api-v1-Group) | 创建用户组 | +| UpdateGroup | [Group](#api-v1-Group) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户组 | +| DeleteGroup | [DeleteGroupRequest](#api-v1-DeleteGroupRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除用户组 | +| GetGroup | [GetGroupRequest](#api-v1-GetGroupRequest) | [Group](#api-v1-Group) | 获取用户组列表 | +| ListGroup | [ListGroupRequest](#api-v1-ListGroupRequest) | [ListGroupReply](#api-v1-ListGroupReply) | | +| GetGroupPermission | [GetGroupPermissionRequest](#api-v1-GetGroupPermissionRequest) | [GroupPermissions](#api-v1-GroupPermissions) | 获取用户组权限列表 | +| UpdateGroupPermission | [UpdateGroupPermissionRequest](#api-v1-UpdateGroupPermissionRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户组权限,给用户组设置权限 | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/health.md b/docs/api/health.md new file mode 100644 index 0000000..87bcd4f --- /dev/null +++ b/docs/api/health.md @@ -0,0 +1,93 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/health.proto](#api_v1_health-proto) + - [PingRequest](#-PingRequest) + - [PongReply](#-PongReply) + + - [HealthAPI](#-HealthAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/health.proto + + + + + +### PingRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | | + + + + + + + + +### PongReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + + + + + + + +### HealthAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Health | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| Ping | [.PingRequest](#PingRequest) | [.PongReply](#PongReply) | | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/permission.md b/docs/api/permission.md new file mode 100644 index 0000000..8e57946 --- /dev/null +++ b/docs/api/permission.md @@ -0,0 +1,168 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/permission.proto](#api_v1_permission-proto) + - [DeletePermissionRequest](#api-v1-DeletePermissionRequest) + - [GetPermissionReply](#api-v1-GetPermissionReply) + - [GetPermissionRequest](#api-v1-GetPermissionRequest) + - [ListPermissionReply](#api-v1-ListPermissionReply) + - [ListPermissionRequest](#api-v1-ListPermissionRequest) + - [Permission](#api-v1-Permission) + + - [PermissionAPI](#api-v1-PermissionAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/permission.proto + + + + + +### DeletePermissionRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### GetPermissionReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| permission | [Permission](#api-v1-Permission) | | | + + + + + + + + +### GetPermissionRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### ListPermissionReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| permission | [Permission](#api-v1-Permission) | repeated | | + + + + + + + + +### ListPermissionRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| wd | [string](#string) | | | +| method | [string](#string) | repeated | | +| path | [string](#string) | | | + + + + + + + + +### Permission + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| method | [string](#string) | | | +| path | [string](#string) | | | +| title | [string](#string) | | | +| description | [string](#string) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + + + + + + + +### PermissionAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| UpdatePermission | [Permission](#api-v1-Permission) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| GetPermission | [GetPermissionRequest](#api-v1-GetPermissionRequest) | [Permission](#api-v1-Permission) | | +| ListPermission | [ListPermissionRequest](#api-v1-ListPermissionRequest) | [ListPermissionReply](#api-v1-ListPermissionReply) | | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/report.md b/docs/api/report.md new file mode 100644 index 0000000..617a3bf --- /dev/null +++ b/docs/api/report.md @@ -0,0 +1,141 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/report.proto](#api_v1_report-proto) + - [DeleteReportRequest](#api-v1-DeleteReportRequest) + - [ListReportReply](#api-v1-ListReportReply) + - [ListReportRequest](#api-v1-ListReportRequest) + - [Report](#api-v1-Report) + + - [ReportAPI](#api-v1-ReportAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/report.proto + + + + + +### DeleteReportRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### ListReportReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| report | [Report](#api-v1-Report) | repeated | | + + + + + + + + +### ListReportRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| wd | [string](#string) | | | +| field | [string](#string) | repeated | | +| order | [string](#string) | | | +| status | [bool](#bool) | repeated | | + + + + + + + + +### Report +这里是proto文件中的结构体,可以根据需要删除或者调整 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| document_id | [int64](#int64) | | | +| user_id | [int64](#int64) | | | +| reason | [int32](#int32) | | | +| status | [bool](#bool) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| document_title | [string](#string) | | | +| remark | [string](#string) | | | +| username | [string](#string) | | | + + + + + + + + + + + + + + +### ReportAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| UpdateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| DeleteReport | [DeleteReportRequest](#api-v1-DeleteReportRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| ListReport | [ListReportRequest](#api-v1-ListReportRequest) | [ListReportReply](#api-v1-ListReportReply) | | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/api/user.md b/docs/api/user.md new file mode 100644 index 0000000..f78a46f --- /dev/null +++ b/docs/api/user.md @@ -0,0 +1,409 @@ +# Protocol Documentation + + +## Table of Contents + +- [api/v1/user.proto](#api_v1_user-proto) + - [DeleteUserRequest](#api-v1-DeleteUserRequest) + - [Dynamic](#api-v1-Dynamic) + - [FindPasswordRequest](#api-v1-FindPasswordRequest) + - [GetUserCaptchaReply](#api-v1-GetUserCaptchaReply) + - [GetUserCaptchaRequest](#api-v1-GetUserCaptchaRequest) + - [GetUserPermissionsReply](#api-v1-GetUserPermissionsReply) + - [GetUserRequest](#api-v1-GetUserRequest) + - [ListUserDynamicReply](#api-v1-ListUserDynamicReply) + - [ListUserDynamicRequest](#api-v1-ListUserDynamicRequest) + - [ListUserReply](#api-v1-ListUserReply) + - [ListUserRequest](#api-v1-ListUserRequest) + - [LoginReply](#api-v1-LoginReply) + - [RegisterAndLoginRequest](#api-v1-RegisterAndLoginRequest) + - [SetUserRequest](#api-v1-SetUserRequest) + - [Sign](#api-v1-Sign) + - [UpdateUserPasswordRequest](#api-v1-UpdateUserPasswordRequest) + - [User](#api-v1-User) + + - [UserAPI](#api-v1-UserAPI) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## api/v1/user.proto + + + + + +### DeleteUserRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | repeated | | + + + + + + + + +### Dynamic + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| user_id | [int64](#int64) | | | +| content | [string](#string) | | | +| type | [int32](#int32) | | 类型 | +| username | [string](#string) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### FindPasswordRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| email | [string](#string) | | | +| token | [string](#string) | | | +| password | [string](#string) | | | +| captcha | [string](#string) | | | +| captcha_id | [string](#string) | | | + + + + + + + + +### GetUserCaptchaReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| enable | [bool](#bool) | | | +| id | [string](#string) | | | +| captcha | [string](#string) | | | +| type | [string](#string) | | | + + + + + + + + +### GetUserCaptchaRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [string](#string) | | 验证码类型:register、login、comment、find_password、upload | + + + + + + + + +### GetUserPermissionsReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| permission | [Permission](#api-v1-Permission) | repeated | | + + + + + + + + +### GetUserRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | + + + + + + + + +### ListUserDynamicReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| dynamic | [Dynamic](#api-v1-Dynamic) | repeated | | + + + + + + + + +### ListUserDynamicRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| id | [int64](#int64) | | | + + + + + + + + +### ListUserReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| total | [int64](#int64) | | | +| user | [User](#api-v1-User) | repeated | | + + + + + + + + +### ListUserRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| page | [int64](#int64) | | | +| size | [int64](#int64) | | | +| wd | [string](#string) | | | +| sort | [string](#string) | | | +| id | [int64](#int64) | repeated | | +| group_id | [int64](#int64) | repeated | | +| status | [int32](#int32) | repeated | | +| limit | [int64](#int64) | | | + + + + + + + + +### LoginReply + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| token | [string](#string) | | | +| user | [User](#api-v1-User) | | | + + + + + + + + +### RegisterAndLoginRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| username | [string](#string) | | | +| password | [string](#string) | | | +| captcha | [string](#string) | | | +| captcha_id | [string](#string) | | | +| email | [string](#string) | | | + + + + + + + + +### SetUserRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| username | [string](#string) | | | +| password | [string](#string) | | | +| group_id | [int64](#int64) | repeated | | +| email | [string](#string) | | | + + + + + + + + +### Sign + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| user_id | [int64](#int64) | | | +| sign_at | [int32](#int32) | | | +| ip | [string](#string) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| award | [int32](#int32) | | 签到积分奖励 | + + + + + + + + +### UpdateUserPasswordRequest +修改用户密码 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int64](#int64) | | | +| old_password | [string](#string) | | | +| new_password | [string](#string) | | | + + + + + + + + +### User + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| login_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| id | [int64](#int64) | | | +| username | [string](#string) | | | +| mobile | [string](#string) | | | +| email | [string](#string) | | | +| address | [string](#string) | | | +| signature | [string](#string) | | | +| last_login_ip | [string](#string) | | | +| register_ip | [string](#string) | | | +| doc_count | [int32](#int32) | | | +| follow_count | [int32](#int32) | | | +| fans_count | [int32](#int32) | | | +| favorite_count | [int32](#int32) | | | +| comment_count | [int32](#int32) | | | +| status | [int32](#int32) | | | +| avatar | [string](#string) | | | +| identity | [string](#string) | | | +| realname | [string](#string) | | | +| group_id | [int64](#int64) | repeated | | +| credit_count | [int32](#int32) | | | + + + + + + + + + + + + + + +### UserAPI + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Register | [RegisterAndLoginRequest](#api-v1-RegisterAndLoginRequest) | [LoginReply](#api-v1-LoginReply) | 用户注册 | +| Login | [RegisterAndLoginRequest](#api-v1-RegisterAndLoginRequest) | [LoginReply](#api-v1-LoginReply) | 用户登录 | +| Logout | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 退出登录 | +| GetUser | [GetUserRequest](#api-v1-GetUserRequest) | [User](#api-v1-User) | 查询用户信息。如果传递了Id参数,则表示查询用户的公开信息,否则查询当前用户的私有信息 | +| UpdateUserPassword | [UpdateUserPasswordRequest](#api-v1-UpdateUserPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 | +| UpdateUserProfile | [User](#api-v1-User) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 | +| DeleteUser | [DeleteUserRequest](#api-v1-DeleteUserRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除用户。需要验证用户权限 | +| AddUser | [SetUserRequest](#api-v1-SetUserRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 新增用户 | +| SetUser | [SetUserRequest](#api-v1-SetUserRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 设置用户 | +| ListUser | [ListUserRequest](#api-v1-ListUserRequest) | [ListUserReply](#api-v1-ListUserReply) | 查询用户列表。对于非管理员,返回相应用户的公开信息; 对于管理员,返回相应用户的绝大部分信息 | +| GetUserCaptcha | [GetUserCaptchaRequest](#api-v1-GetUserCaptchaRequest) | [GetUserCaptchaReply](#api-v1-GetUserCaptchaReply) | GetUserCaptcha 获取用户验证码 | +| GetUserPermissions | [.google.protobuf.Empty](#google-protobuf-Empty) | [GetUserPermissionsReply](#api-v1-GetUserPermissionsReply) | GetUserCaptcha 获取用户验证码 | +| CanIUploadDocument | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 用户是否可以上传文档 | +| ListUserDynamic | [ListUserDynamicRequest](#api-v1-ListUserDynamicRequest) | [ListUserDynamicReply](#api-v1-ListUserDynamicReply) | 获取用户动态,包括获取关注的用户的动态 | +| SignToday | [.google.protobuf.Empty](#google-protobuf-Empty) | [Sign](#api-v1-Sign) | 每日签到 | +| GetSignedToday | [.google.protobuf.Empty](#google-protobuf-Empty) | [Sign](#api-v1-Sign) | 获取今日已签到记录 | +| FindPasswordStepOne | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| FindPasswordStepTwo | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 6f82cd3..363af8b 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -3,31 +3,28 @@ openapi: 3.0.3 info: - title: "" + title: UserAPI API version: 0.0.1 paths: - /api/v1/article: + /api/v1/user: get: tags: - - ArticleAPI - operationId: ArticleAPI_GetArticle + - UserAPI + description: 查询用户信息。如果传递了Id参数,则表示查询用户的公开信息,否则查询当前用户的私有信息 + operationId: UserAPI_GetUser parameters: - name: id in: query schema: type: integer format: int64 - - name: identifier - in: query - schema: - type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/Article' + $ref: '#/components/schemas/User' default: description: Default error response content: @@ -36,13 +33,14 @@ paths: $ref: '#/components/schemas/Status' put: tags: - - ArticleAPI - operationId: ArticleAPI_UpdateArticle + - UserAPI + description: 设置用户 + operationId: UserAPI_SetUser requestBody: content: application/json: schema: - $ref: '#/components/schemas/Article' + $ref: '#/components/schemas/SetUserRequest' required: true responses: "200": @@ -56,13 +54,14 @@ paths: $ref: '#/components/schemas/Status' post: tags: - - ArticleAPI - operationId: ArticleAPI_CreateArticle + - UserAPI + description: 新增用户 + operationId: UserAPI_AddUser requestBody: content: application/json: schema: - $ref: '#/components/schemas/Article' + $ref: '#/components/schemas/SetUserRequest' required: true responses: "200": @@ -76,8 +75,9 @@ paths: $ref: '#/components/schemas/Status' delete: tags: - - ArticleAPI - operationId: ArticleAPI_DeleteArticle + - UserAPI + description: 删除用户。需要验证用户权限 + operationId: UserAPI_DeleteUser parameters: - name: id in: query @@ -96,33 +96,30 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/article/list: + /api/v1/user/caniuploaddocument: + get: + tags: + - UserAPI + description: 用户是否可以上传文档 + operationId: UserAPI_CanIUploadDocument + responses: + "200": + description: OK + content: {} + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/user/captcha: get: tags: - - ArticleAPI - operationId: ArticleAPI_ListArticle + - UserAPI + description: GetUserCaptcha 获取用户验证码 + operationId: UserAPI_GetUserCaptcha parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: field - in: query - schema: - type: array - items: - type: string - - name: order + - name: type in: query schema: type: string @@ -132,19 +129,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListArticleReply' + $ref: '#/components/schemas/GetUserCaptchaReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/attachment: + /api/v1/user/dynamic: get: tags: - - AttachmentAPI - operationId: AttachmentAPI_GetAttachment + - UserAPI + description: 获取用户动态,包括获取关注的用户的动态 + operationId: UserAPI_ListUserDynamic parameters: + - name: page + in: query + schema: + type: integer + format: int64 + - name: size + in: query + schema: + type: integer + format: int64 - name: id in: query schema: @@ -156,22 +164,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Attachment' + $ref: '#/components/schemas/ListUserDynamicReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - put: + /api/v1/user/findpassword/stepone: + post: tags: - - AttachmentAPI - operationId: AttachmentAPI_UpdateAttachment + - UserAPI + operationId: UserAPI_FindPasswordStepOne requestBody: content: application/json: schema: - $ref: '#/components/schemas/Attachment' + $ref: '#/components/schemas/FindPasswordRequest' required: true responses: "200": @@ -183,18 +192,17 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - delete: + /api/v1/user/findpassword/steptwo: + put: tags: - - AttachmentAPI - operationId: AttachmentAPI_DeleteAttachment - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 + - UserAPI + operationId: UserAPI_FindPasswordStepTwo + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FindPasswordRequest' + required: true responses: "200": description: OK @@ -205,11 +213,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/attachment/list: + /api/v1/user/list: get: tags: - - AttachmentAPI - operationId: AttachmentAPI_ListAttachment + - UserAPI + description: |- + 查询用户列表。对于非管理员,返回相应用户的公开信息; + 对于管理员,返回相应用户的绝大部分信息 + operationId: UserAPI_ListUser parameters: - name: page in: query @@ -225,50 +236,32 @@ paths: in: query schema: type: string - - name: enable + - name: sort in: query schema: - type: array - items: - type: boolean - - name: userId + type: string + - name: id in: query schema: type: array items: type: integer format: int64 - - name: type + - name: groupId in: query schema: type: array items: type: integer format: int64 - - name: ext + - name: status in: query schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListAttachmentReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/banner: - get: - tags: - - BannerAPI - operationId: BannerAPI_GetBanner - parameters: - - name: id + type: array + items: + type: integer + format: int32 + - name: limit in: query schema: type: integer @@ -279,42 +272,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Banner' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - BannerAPI - operationId: BannerAPI_UpdateBanner - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Banner' - required: true - responses: - "200": - description: OK - content: {} + $ref: '#/components/schemas/ListUserReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/user/login: post: tags: - - BannerAPI - operationId: BannerAPI_CreateBanner + - UserAPI + description: 用户登录 + operationId: UserAPI_Login requestBody: content: application/json: schema: - $ref: '#/components/schemas/Banner' + $ref: '#/components/schemas/RegisterAndLoginRequest' required: true responses: "200": @@ -322,25 +297,19 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Banner' + $ref: '#/components/schemas/LoginReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/user/logout: delete: tags: - - BannerAPI - operationId: BannerAPI_DeleteBanner - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 + - UserAPI + description: 退出登录 + operationId: UserAPI_Logout responses: "200": description: OK @@ -351,91 +320,62 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/banner/list: - get: + /api/v1/user/password: + put: tags: - - BannerAPI - operationId: BannerAPI_ListBanner - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: type - in: query - schema: - type: array - items: - type: integer - format: int32 - - name: enable - in: query - schema: - type: array - items: - type: boolean - - name: wd - in: query - schema: - type: string - - name: field - in: query - schema: - type: array - items: - type: string + - UserAPI + description: |- + 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; + 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 + operationId: UserAPI_UpdateUserPassword + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserPasswordRequest' + required: true responses: "200": description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListBannerReply' + content: {} default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/category: + /api/v1/user/permission: get: tags: - - CategoryAPI - operationId: CategoryAPI_GetCategory - parameters: - - name: id - in: query - schema: - type: integer - format: int64 + - UserAPI + description: GetUserCaptcha 获取用户验证码 + operationId: UserAPI_GetUserPermissions responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/Category' + $ref: '#/components/schemas/GetUserPermissionsReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/user/profile: put: tags: - - CategoryAPI - operationId: CategoryAPI_UpdateCategory + - UserAPI + description: |- + 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; + 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 + operationId: UserAPI_UpdateUserProfile requestBody: content: application/json: schema: - $ref: '#/components/schemas/Category' + $ref: '#/components/schemas/User' required: true responses: "200": @@ -447,3273 +387,71 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/user/register: post: tags: - - CategoryAPI - operationId: CategoryAPI_CreateCategory + - UserAPI + description: 用户注册 + operationId: UserAPI_Register requestBody: content: application/json: schema: - $ref: '#/components/schemas/Category' + $ref: '#/components/schemas/RegisterAndLoginRequest' required: true responses: "200": description: OK - content: {} + content: + application/json: + schema: + $ref: '#/components/schemas/LoginReply' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - delete: + /api/v1/user/sign: + get: tags: - - CategoryAPI - operationId: CategoryAPI_DeleteCategory - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/category/list: - get: - tags: - - CategoryAPI - operationId: CategoryAPI_ListCategory - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: parentId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: enable - in: query - schema: - type: array - items: - type: boolean - - name: field - in: query - schema: - type: array - items: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListCategoryReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/comment: - get: - tags: - - CommentAPI - description: 获取单个评论 - operationId: CommentAPI_GetComment - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - CommentAPI - description: 更新评论,仅限管理员操作 - operationId: CommentAPI_UpdateComment - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - CommentAPI - operationId: CommentAPI_CreateComment - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateCommentRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - CommentAPI - description: 管理员或用户自己删除自己的评论 - operationId: CommentAPI_DeleteComment - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/comment/check: - post: - tags: - - CommentAPI - description: 审核评论 - operationId: CommentAPI_CheckComment - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CheckCommentRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/comment/list: - get: - tags: - - CommentAPI - description: 获取评论列表 - operationId: CommentAPI_ListComment - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: field - in: query - schema: - type: array - items: - type: string - - name: order - in: query - schema: - type: string - - name: status - in: query - schema: - type: array - items: - type: integer - format: int32 - - name: documentId - in: query - schema: - type: integer - format: int64 - - name: userId - in: query - schema: - type: integer - format: int64 - - name: parentId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: withDocumentTitle - in: query - schema: - type: boolean + - UserAPI + description: 获取今日已签到记录 + operationId: UserAPI_GetSignedToday responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/ListCommentReply' + $ref: '#/components/schemas/Sign' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/config: put: tags: - - ConfigAPI - description: UpdateConfig 更新配置 - operationId: ConfigAPI_UpdateConfig - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Configs' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/config/list: - get: - tags: - - ConfigAPI - description: ListConfig 查询配置项 - operationId: ConfigAPI_ListConfig - parameters: - - name: category - in: query - schema: - type: array - items: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Configs' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document: - get: - tags: - - DocumentAPI - operationId: DocumentAPI_GetDocument - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - - name: withAuthor - in: query - schema: - type: boolean + - UserAPI + description: 每日签到 + operationId: UserAPI_SignToday responses: "200": description: OK content: - application/json: - schema: - $ref: '#/components/schemas/Document' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - DocumentAPI - operationId: DocumentAPI_UpdateDocument - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - DocumentAPI - operationId: DocumentAPI_CreateDocument - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDocumentRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - DocumentAPI - operationId: DocumentAPI_DeleteDocument - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/download: - get: - tags: - - DocumentAPI - operationId: DocumentAPI_DownloadDocument - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - - name: title - in: query - schema: - type: string - - name: keywords - in: query - schema: - type: string - - name: description - in: query - schema: - type: string - - name: userId - in: query - schema: - type: integer - format: int64 - - name: cover - in: query - schema: - type: string - - name: width - in: query - schema: - type: integer - format: int32 - - name: height - in: query - schema: - type: integer - format: int32 - - name: preview - in: query - schema: - type: integer - format: int32 - - name: pages - in: query - schema: - type: integer - format: int32 - - name: uuid - in: query - schema: - type: string - - name: downloadCount - in: query - schema: - type: integer - format: int32 - - name: viewCount - in: query - schema: - type: integer - format: int32 - - name: favoriteCount - in: query - schema: - type: integer - format: int32 - - name: commentCount - in: query - schema: - type: integer - format: int32 - - name: score - in: query - schema: - type: integer - format: int32 - - name: scoreCount - in: query - schema: - type: integer - format: int32 - - name: price - in: query - schema: - type: integer - format: int32 - - name: size - in: query - schema: - type: integer - format: int64 - - name: status - in: query - schema: - type: integer - format: int32 - - name: createdAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: createdAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: updatedAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: updatedAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: deletedAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: deletedAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: recommendAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: recommendAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: deletedUserId - in: query - schema: - type: integer - format: int64 - - name: username - in: query - schema: - type: string - - name: categoryId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: deletedUsername - in: query - schema: - type: string - - name: ext - in: query - schema: - type: string - - name: attachment.id - in: query - schema: - type: integer - format: int64 - - name: attachment.hash - in: query - schema: - type: string - - name: attachment.userId - in: query - schema: - type: integer - format: int64 - - name: attachment.typeId - in: query - schema: - type: integer - format: int64 - - name: attachment.type - in: query - schema: - type: integer - format: int32 - - name: attachment.enable - in: query - schema: - type: boolean - - name: attachment.path - in: query - schema: - type: string - - name: attachment.name - in: query - schema: - type: string - - name: attachment.size - in: query - schema: - type: integer - format: int64 - - name: attachment.width - in: query - schema: - type: integer - format: int64 - - name: attachment.height - in: query - schema: - type: integer - format: int64 - - name: attachment.ext - in: query - schema: - type: string - - name: attachment.ip - in: query - schema: - type: string - - name: attachment.username - in: query - schema: - type: string - - name: attachment.typeName - in: query - schema: - type: string - - name: attachment.description - in: query - schema: - type: string - - name: attachment.createdAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: attachment.createdAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: attachment.updatedAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: attachment.updatedAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: user.loginAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: user.loginAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: user.createdAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: user.createdAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: user.id - in: query - schema: - type: integer - format: int64 - - name: user.username - in: query - schema: - type: string - - name: user.mobile - in: query - schema: - type: string - - name: user.email - in: query - schema: - type: string - - name: user.address - in: query - schema: - type: string - - name: user.signature - in: query - schema: - type: string - - name: user.lastLoginIp - in: query - schema: - type: string - - name: user.registerIp - in: query - schema: - type: string - - name: user.docCount - in: query - schema: - type: integer - format: int32 - - name: user.followCount - in: query - schema: - type: integer - format: int32 - - name: user.fansCount - in: query - schema: - type: integer - format: int32 - - name: user.favoriteCount - in: query - schema: - type: integer - format: int32 - - name: user.commentCount - in: query - schema: - type: integer - format: int32 - - name: user.status - in: query - schema: - type: integer - format: int32 - - name: user.avatar - in: query - schema: - type: string - - name: user.identity - in: query - schema: - type: string - - name: user.realname - in: query - schema: - type: string - - name: user.groupId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: user.creditCount - in: query - schema: - type: integer - format: int32 - - name: enableGzip - in: query - schema: - type: boolean - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DownloadDocumentReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/home: - get: - tags: - - DocumentAPI - operationId: DocumentAPI_ListDocumentForHome - parameters: - - name: limit - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListDocumentForHomeResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/list: - get: - tags: - - DocumentAPI - operationId: DocumentAPI_ListDocument - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: field - in: query - schema: - type: array - items: - type: string - - name: order - in: query - schema: - type: string - - name: categoryId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: userId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: status - in: query - schema: - type: array - items: - type: integer - format: int32 - - name: isRecommend - in: query - schema: - type: array - items: - type: boolean - - name: limit - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListDocumentReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/recommend: - put: - tags: - - DocumentAPI - operationId: DocumentAPI_SetDocumentRecommend - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetDocumentRecommendRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/recycle: - get: - tags: - - RecycleAPI - description: 文档回收站列表 - operationId: RecycleAPI_ListRecycleDocument - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: field - in: query - schema: - type: array - items: - type: string - - name: order - in: query - schema: - type: string - - name: categoryId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: userId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: status - in: query - schema: - type: array - items: - type: integer - format: int32 - - name: isRecommend - in: query - schema: - type: array - items: - type: boolean - - name: limit - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListDocumentReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - RecycleAPI - description: 恢复回收站文档,支持恢复单个文档或者是批量恢复 - operationId: RecycleAPI_RecoverRecycleDocument - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RecoverRecycleDocumentRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - RecycleAPI - description: 删除回收站文档 - operationId: RecycleAPI_DeleteRecycleDocument - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/recycle/all: - delete: - tags: - - RecycleAPI - description: 清空回收站文档 - operationId: RecycleAPI_ClearRecycleDocument - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/related: - get: - tags: - - DocumentAPI - operationId: DocumentAPI_GetRelatedDocuments - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - - name: title - in: query - schema: - type: string - - name: keywords - in: query - schema: - type: string - - name: description - in: query - schema: - type: string - - name: userId - in: query - schema: - type: integer - format: int64 - - name: cover - in: query - schema: - type: string - - name: width - in: query - schema: - type: integer - format: int32 - - name: height - in: query - schema: - type: integer - format: int32 - - name: preview - in: query - schema: - type: integer - format: int32 - - name: pages - in: query - schema: - type: integer - format: int32 - - name: uuid - in: query - schema: - type: string - - name: downloadCount - in: query - schema: - type: integer - format: int32 - - name: viewCount - in: query - schema: - type: integer - format: int32 - - name: favoriteCount - in: query - schema: - type: integer - format: int32 - - name: commentCount - in: query - schema: - type: integer - format: int32 - - name: score - in: query - schema: - type: integer - format: int32 - - name: scoreCount - in: query - schema: - type: integer - format: int32 - - name: price - in: query - schema: - type: integer - format: int32 - - name: size - in: query - schema: - type: integer - format: int64 - - name: status - in: query - schema: - type: integer - format: int32 - - name: createdAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: createdAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: updatedAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: updatedAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: deletedAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: deletedAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: recommendAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: recommendAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: deletedUserId - in: query - schema: - type: integer - format: int64 - - name: username - in: query - schema: - type: string - - name: categoryId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: deletedUsername - in: query - schema: - type: string - - name: ext - in: query - schema: - type: string - - name: attachment.id - in: query - schema: - type: integer - format: int64 - - name: attachment.hash - in: query - schema: - type: string - - name: attachment.userId - in: query - schema: - type: integer - format: int64 - - name: attachment.typeId - in: query - schema: - type: integer - format: int64 - - name: attachment.type - in: query - schema: - type: integer - format: int32 - - name: attachment.enable - in: query - schema: - type: boolean - - name: attachment.path - in: query - schema: - type: string - - name: attachment.name - in: query - schema: - type: string - - name: attachment.size - in: query - schema: - type: integer - format: int64 - - name: attachment.width - in: query - schema: - type: integer - format: int64 - - name: attachment.height - in: query - schema: - type: integer - format: int64 - - name: attachment.ext - in: query - schema: - type: string - - name: attachment.ip - in: query - schema: - type: string - - name: attachment.username - in: query - schema: - type: string - - name: attachment.typeName - in: query - schema: - type: string - - name: attachment.description - in: query - schema: - type: string - - name: attachment.createdAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: attachment.createdAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: attachment.updatedAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: attachment.updatedAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: user.loginAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: user.loginAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: user.createdAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: user.createdAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: user.id - in: query - schema: - type: integer - format: int64 - - name: user.username - in: query - schema: - type: string - - name: user.mobile - in: query - schema: - type: string - - name: user.email - in: query - schema: - type: string - - name: user.address - in: query - schema: - type: string - - name: user.signature - in: query - schema: - type: string - - name: user.lastLoginIp - in: query - schema: - type: string - - name: user.registerIp - in: query - schema: - type: string - - name: user.docCount - in: query - schema: - type: integer - format: int32 - - name: user.followCount - in: query - schema: - type: integer - format: int32 - - name: user.fansCount - in: query - schema: - type: integer - format: int32 - - name: user.favoriteCount - in: query - schema: - type: integer - format: int32 - - name: user.commentCount - in: query - schema: - type: integer - format: int32 - - name: user.status - in: query - schema: - type: integer - format: int32 - - name: user.avatar - in: query - schema: - type: string - - name: user.identity - in: query - schema: - type: string - - name: user.realname - in: query - schema: - type: string - - name: user.groupId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: user.creditCount - in: query - schema: - type: integer - format: int32 - - name: enableGzip - in: query - schema: - type: boolean - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListDocumentReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/score: - get: - tags: - - DocumentAPI - description: 获取当前登录用户的文档评分 - operationId: DocumentAPI_GetDocumentScore - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - - name: documentId - in: query - schema: - type: integer - format: int64 - - name: userId - in: query - schema: - type: integer - format: int64 - - name: score - in: query - schema: - type: integer - format: int32 - - name: createdAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: createdAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - - name: updatedAt.seconds - in: query - description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - schema: - type: integer - format: int64 - - name: updatedAt.nanos - in: query - description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - schema: - type: integer - format: int32 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DocumentScore' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - DocumentAPI - description: 设置文档评分 - operationId: DocumentAPI_SetDocumentScore - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DocumentScore' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/document/search: - get: - tags: - - DocumentAPI - operationId: DocumentAPI_SearchDocument - parameters: - - name: page - in: query - schema: - type: integer - format: int32 - - name: size - in: query - schema: - type: integer - format: int32 - - name: wd - in: query - schema: - type: string - - name: categoryId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: sort - in: query - schema: - type: string - - name: ext - in: query - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SearchDocumentReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/envs: - get: - tags: - - ConfigAPI - description: 获取系统环境依赖检测 - operationId: ConfigAPI_GetEnvs - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Envs' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/favorite: - get: - tags: - - FavoriteAPI - description: 根据文章id,查询用户是否有收藏某篇文档 - operationId: FavoriteAPI_GetFavorite - parameters: - - name: documentId - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Favorite' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - FavoriteAPI - description: 添加收藏 - operationId: FavoriteAPI_CreateFavorite - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Favorite' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Favorite' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - FavoriteAPI - description: 取消收藏 - operationId: FavoriteAPI_DeleteFavorite - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/favorite/list: - get: - tags: - - FavoriteAPI - description: 查询用户的收藏 - operationId: FavoriteAPI_ListFavorite - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: userId - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListFavoriteReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/friendlink: - get: - tags: - - FriendlinkAPI - operationId: FriendlinkAPI_GetFriendlink - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Friendlink' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - FriendlinkAPI - operationId: FriendlinkAPI_UpdateFriendlink - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Friendlink' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - FriendlinkAPI - operationId: FriendlinkAPI_CreateFriendlink - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Friendlink' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Friendlink' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - FriendlinkAPI - operationId: FriendlinkAPI_DeleteFriendlink - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/friendlink/list: - get: - tags: - - FriendlinkAPI - operationId: FriendlinkAPI_ListFriendlink - parameters: - - name: page - in: query - schema: - type: integer - format: int32 - - name: size - in: query - schema: - type: integer - format: int32 - - name: wd - in: query - schema: - type: string - - name: enable - in: query - schema: - type: array - items: - type: boolean - - name: field - in: query - schema: - type: array - items: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListFriendlinkReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/group: - get: - tags: - - GroupAPI - description: 获取用户组列表 - operationId: GroupAPI_GetGroup - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - - name: title - in: query - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Group' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - GroupAPI - description: 更新用户组 - operationId: GroupAPI_UpdateGroup - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Group' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - GroupAPI - description: 创建用户组 - operationId: GroupAPI_CreateGroup - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Group' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Group' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - GroupAPI - description: 删除用户组 - operationId: GroupAPI_DeleteGroup - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/group/list: - get: - tags: - - GroupAPI - operationId: GroupAPI_ListGroup - parameters: - - name: wd - in: query - schema: - type: string - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: sort - in: query - schema: - type: string - - name: field - in: query - schema: - type: array - items: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListGroupReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/group/permission: - get: - tags: - - GroupAPI - description: 获取用户组权限列表 - operationId: GroupAPI_GetGroupPermission - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GroupPermissions' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - GroupAPI - description: 更新用户组权限,给用户组设置权限 - operationId: GroupAPI_UpdateGroupPermission - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateGroupPermissionRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/permission: - get: - tags: - - PermissionAPI - operationId: PermissionAPI_GetPermission - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Permission' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - PermissionAPI - operationId: PermissionAPI_UpdatePermission - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Permission' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/permission/list: - get: - tags: - - PermissionAPI - operationId: PermissionAPI_ListPermission - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: method - in: query - schema: - type: array - items: - type: string - - name: path - in: query - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListPermissionReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/ping: - get: - tags: - - HealthAPI - operationId: HealthAPI_Ping - parameters: - - name: name - in: query - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PongReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/report: - put: - tags: - - ReportAPI - operationId: ReportAPI_UpdateReport - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Report' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - ReportAPI - operationId: ReportAPI_CreateReport - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Report' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - ReportAPI - operationId: ReportAPI_DeleteReport - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/report/list: - get: - tags: - - ReportAPI - operationId: ReportAPI_ListReport - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: field - in: query - schema: - type: array - items: - type: string - - name: order - in: query - schema: - type: string - - name: status - in: query - schema: - type: array - items: - type: boolean - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListReportReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/settings: - get: - tags: - - ConfigAPI - description: 获取系统配置(针对所有用户,只读) - operationId: ConfigAPI_GetSettings - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Settings' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/sitemap: - put: - tags: - - ConfigAPI - description: 更新站点地图 - operationId: ConfigAPI_UpdateSitemap - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/stats: - get: - tags: - - ConfigAPI - description: 获取系统配置 - operationId: ConfigAPI_GetStats - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Stats' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user: - get: - tags: - - UserAPI - description: 查询用户信息。如果传递了Id参数,则表示查询用户的公开信息,否则查询当前用户的私有信息 - operationId: UserAPI_GetUser - parameters: - - name: id - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/User' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - UserAPI - description: 设置用户 - operationId: UserAPI_SetUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetUserRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - post: - tags: - - UserAPI - description: 新增用户 - operationId: UserAPI_AddUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetUserRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - delete: - tags: - - UserAPI - description: 删除用户。需要验证用户权限 - operationId: UserAPI_DeleteUser - parameters: - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/caniuploaddocument: - get: - tags: - - UserAPI - description: 用户是否可以上传文档 - operationId: UserAPI_CanIUploadDocument - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/captcha: - get: - tags: - - UserAPI - description: GetUserCaptcha 获取用户验证码 - operationId: UserAPI_GetUserCaptcha - parameters: - - name: type - in: query - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetUserCaptchaReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/dynamic: - get: - tags: - - UserAPI - description: 获取用户动态,包括获取关注的用户的动态 - operationId: UserAPI_ListUserDynamic - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: id - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListUserDynamicReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/findpassword/stepone: - post: - tags: - - UserAPI - operationId: UserAPI_FindPasswordStepOne - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FindPasswordRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/findpassword/steptwo: - put: - tags: - - UserAPI - operationId: UserAPI_FindPasswordStepTwo - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FindPasswordRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/list: - get: - tags: - - UserAPI - description: |- - 查询用户列表。对于非管理员,返回相应用户的公开信息; - 对于管理员,返回相应用户的绝大部分信息 - operationId: UserAPI_ListUser - parameters: - - name: page - in: query - schema: - type: integer - format: int64 - - name: size - in: query - schema: - type: integer - format: int64 - - name: wd - in: query - schema: - type: string - - name: sort - in: query - schema: - type: string - - name: id - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: groupId - in: query - schema: - type: array - items: - type: integer - format: int64 - - name: status - in: query - schema: - type: array - items: - type: integer - format: int32 - - name: limit - in: query - schema: - type: integer - format: int64 - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListUserReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/login: - post: - tags: - - UserAPI - description: 用户登录 - operationId: UserAPI_Login - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterAndLoginRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/LoginReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/logout: - delete: - tags: - - UserAPI - description: 退出登录 - operationId: UserAPI_Logout - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/password: - put: - tags: - - UserAPI - description: |- - 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; - 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 - operationId: UserAPI_UpdateUserPassword - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserPasswordRequest' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/permission: - get: - tags: - - UserAPI - description: GetUserCaptcha 获取用户验证码 - operationId: UserAPI_GetUserPermissions - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/GetUserPermissionsReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/profile: - put: - tags: - - UserAPI - description: |- - 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; - 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 - operationId: UserAPI_UpdateUserProfile - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/register: - post: - tags: - - UserAPI - description: 用户注册 - operationId: UserAPI_Register - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterAndLoginRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/LoginReply' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /api/v1/user/sign: - get: - tags: - - UserAPI - description: 获取今日已签到记录 - operationId: UserAPI_GetSignedToday - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Sign' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - put: - tags: - - UserAPI - description: 每日签到 - operationId: UserAPI_SignToday - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Sign' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /health: - get: - tags: - - HealthAPI - operationId: HealthAPI_Health - responses: - "200": - description: OK - content: {} - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' -components: - schemas: - Article: - type: object - properties: - id: - type: integer - format: int64 - identifier: - type: string - author: - type: string - viewCount: - type: integer - format: int64 - title: - type: string - keywords: - type: string - description: - type: string - content: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - Attachment: - type: object - properties: - id: - type: integer - format: int64 - hash: - type: string - userId: - type: integer - format: int64 - typeId: - type: integer - format: int64 - type: - type: integer - format: int32 - enable: - type: boolean - path: - type: string - name: - type: string - size: - type: integer - format: int64 - width: - type: integer - format: int64 - height: - type: integer - format: int64 - ext: - type: string - ip: - type: string - username: - type: string - typeName: - type: string - description: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - Banner: - type: object - properties: - id: - type: integer - format: int64 - title: - type: string - path: - type: string - sort: - type: integer - format: int32 - enable: - type: boolean - type: - type: integer - format: int32 - url: - type: string - description: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - Category: - type: object - properties: - id: - type: integer - format: int32 - parentId: - type: integer - format: int32 - title: - type: string - docCount: - type: integer - format: int32 - sort: - type: integer - format: int32 - enable: - type: boolean - cover: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - CheckCommentRequest: - type: object - properties: - id: - type: array - items: - type: integer - format: int64 - status: - type: integer - format: int32 - Comment: - type: object - properties: - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - id: - type: integer - format: int64 - parentId: - type: integer - format: int64 - content: - type: string - documentId: - type: integer - format: int64 - status: - type: integer - format: int32 - commentCount: - type: integer - format: int32 - userId: - type: integer - format: int64 - user: - $ref: '#/components/schemas/User' - documentTitle: - type: string - Config: - type: object - properties: - id: - type: integer - format: int64 - label: - type: string - name: - type: string - value: - type: string - placeholder: - type: string - inputType: - type: string - category: - type: string - sort: - type: integer - format: int32 - options: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - ConfigFooter: - type: object - properties: - about: - type: string - contact: - type: string - agreement: - type: string - copyright: - type: string - feedback: - type: string - description: 底链配置项 - ConfigSecurity: - type: object - properties: - isClose: - type: boolean - closeStatement: - type: string - enableRegister: - type: boolean - enableCaptchaLogin: - type: boolean - enableCaptchaRegister: - type: boolean - enableCaptchaComment: - type: boolean - enableCaptchaFindPassword: - type: boolean - enableCaptchaUpload: - type: boolean - maxDocumentSize: - type: integer - format: int32 - documentAllowedExt: - type: array - items: - type: string - description: 安全配置 - ConfigSystem: - type: object - properties: - domain: - type: string - title: - type: string - keywords: - type: string - description: - type: string - logo: - type: string - favicon: - type: string - icp: - type: string - analytics: - type: string - sitename: - type: string - copyrightStartYear: - type: string - registerBackground: - type: string - loginBackground: - type: string - recommendWords: - type: array - items: - type: string - version: - type: string - description: 系统配置项 - Configs: - type: object - properties: - config: - type: array - items: - $ref: '#/components/schemas/Config' - CreateCommentRequest: - type: object - properties: - documentId: - type: integer - format: int64 - parentId: - type: integer - format: int64 - content: - type: string - captchaId: - type: string - captcha: - type: string - CreateDocumentItem: - type: object - properties: - title: - type: string - attachmentId: - type: integer - format: int64 - price: - type: integer - format: int32 - CreateDocumentRequest: - type: object - properties: - overwrite: - type: boolean - categoryId: - type: array - items: - type: integer - format: int64 - document: - type: array - items: - $ref: '#/components/schemas/CreateDocumentItem' - Document: - type: object - properties: - id: - type: integer - format: int64 - title: - type: string - keywords: - type: string - description: - type: string - userId: - type: integer - format: int64 - cover: - type: string - width: - type: integer - format: int32 - height: - type: integer - format: int32 - preview: - type: integer - format: int32 - pages: - type: integer - format: int32 - uuid: - type: string - downloadCount: - type: integer - format: int32 - viewCount: - type: integer - format: int32 - favoriteCount: - type: integer - format: int32 - commentCount: - type: integer - format: int32 - score: - type: integer - format: int32 - scoreCount: - type: integer - format: int32 - price: - type: integer - format: int32 - size: - type: integer - format: int64 - status: - type: integer - format: int32 - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - deletedAt: - type: string - format: date-time - recommendAt: - type: string - format: date-time - deletedUserId: - type: integer - format: int64 - username: - type: string - categoryId: - type: array - items: - type: integer - format: int64 - deletedUsername: - type: string - ext: - type: string - attachment: - $ref: '#/components/schemas/Attachment' - user: - $ref: '#/components/schemas/User' - enableGzip: - type: boolean - DocumentScore: - type: object - properties: - id: - type: integer - format: int64 - documentId: - type: integer - format: int64 - userId: - type: integer - format: int64 - score: - type: integer - format: int32 - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - DownloadDocumentReply: - type: object - properties: - url: - type: string - Dynamic: - type: object - properties: - id: - type: integer - format: int64 - userId: - type: integer - format: int64 - content: - type: string - type: - type: integer - format: int32 - username: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - EnvDependent: - type: object - properties: - name: - type: string - description: - type: string - isInstalled: - type: boolean - error: - type: string - checkedAt: - type: string - format: date-time - cmd: - type: string - isRequired: - type: boolean - Envs: - type: object - properties: - envs: - type: array - items: - $ref: '#/components/schemas/EnvDependent' - Favorite: + application/json: + schema: + $ref: '#/components/schemas/Sign' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + schemas: + Dynamic: type: object properties: id: @@ -3722,22 +460,13 @@ components: userId: type: integer format: int64 - documentId: - type: integer - format: int64 - title: - type: string - ext: + content: type: string - score: - type: integer - format: int32 - size: - type: integer - format: int64 - pages: + type: type: integer format: int32 + username: + type: string createdAt: type: string format: date-time @@ -3757,29 +486,6 @@ components: type: string captchaId: type: string - Friendlink: - type: object - properties: - id: - type: integer - format: int32 - title: - type: string - link: - type: string - description: - type: string - sort: - type: integer - format: int32 - enable: - type: boolean - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time GetUserCaptchaReply: type: object properties: @@ -3806,177 +512,6 @@ components: description: The type of the serialized message. additionalProperties: true description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. - Group: - type: object - properties: - id: - type: integer - format: int64 - title: - type: string - color: - type: string - isDefault: - type: boolean - isDisplay: - type: boolean - description: - type: string - userCount: - type: integer - format: int32 - sort: - type: integer - format: int32 - enableUpload: - type: boolean - enableCommentApproval: - type: boolean - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - GroupPermissions: - type: object - properties: - permissionId: - type: array - items: - type: integer - format: int64 - ListArticleReply: - type: object - properties: - total: - type: integer - format: int64 - article: - type: array - items: - $ref: '#/components/schemas/Article' - ListAttachmentReply: - type: object - properties: - total: - type: integer - format: int64 - attachment: - type: array - items: - $ref: '#/components/schemas/Attachment' - ListBannerReply: - type: object - properties: - total: - type: integer - format: int64 - banner: - type: array - items: - $ref: '#/components/schemas/Banner' - ListCategoryReply: - type: object - properties: - total: - type: integer - format: int64 - category: - type: array - items: - $ref: '#/components/schemas/Category' - ListCommentReply: - type: object - properties: - total: - type: integer - format: int64 - comment: - type: array - items: - $ref: '#/components/schemas/Comment' - ListDocumentForHomeItem: - type: object - properties: - categoryId: - type: integer - format: int64 - categoryCover: - type: string - categoryName: - type: string - document: - type: array - items: - $ref: '#/components/schemas/Document' - ListDocumentForHomeResponse: - type: object - properties: - document: - type: array - items: - $ref: '#/components/schemas/ListDocumentForHomeItem' - ListDocumentReply: - type: object - properties: - total: - type: integer - format: int64 - document: - type: array - items: - $ref: '#/components/schemas/Document' - ListFavoriteReply: - type: object - properties: - total: - type: integer - format: int64 - favorite: - type: array - items: - $ref: '#/components/schemas/Favorite' - ListFriendlinkReply: - type: object - properties: - friendlink: - type: array - items: - $ref: '#/components/schemas/Friendlink' - total: - type: integer - format: int64 - ListGroupReply: - type: object - properties: - group: - type: array - items: - $ref: '#/components/schemas/Group' - total: - type: integer - format: int64 - ListPermissionReply: - type: object - properties: - total: - type: integer - format: int64 - permission: - type: array - items: - $ref: '#/components/schemas/Permission' - ListReportReply: - type: object - properties: - total: - type: integer - format: int64 - report: - type: array - items: - $ref: '#/components/schemas/Report' ListUserDynamicReply: type: object properties: @@ -4024,22 +559,6 @@ components: updatedAt: type: string format: date-time - PongReply: - type: object - properties: - name: - type: string - createdAt: - type: string - format: date-time - RecoverRecycleDocumentRequest: - type: object - properties: - id: - type: array - items: - type: integer - format: int64 RegisterAndLoginRequest: type: object properties: @@ -4053,59 +572,6 @@ components: type: string email: type: string - Report: - type: object - properties: - id: - type: integer - format: int64 - documentId: - type: integer - format: int64 - userId: - type: integer - format: int64 - reason: - type: integer - format: int32 - status: - type: boolean - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - documentTitle: - type: string - remark: - type: string - username: - type: string - description: 这里是proto文件中的结构体,可以根据需要删除或者调整 - SearchDocumentReply: - type: object - properties: - total: - type: integer - format: int64 - spend: - type: string - document: - type: array - items: - $ref: '#/components/schemas/Document' - SetDocumentRecommendRequest: - type: object - properties: - id: - type: array - items: - type: integer - format: int64 - type: - type: integer - format: int32 SetUserRequest: type: object properties: @@ -4121,15 +587,8 @@ components: items: type: integer format: int64 - Settings: - type: object - properties: - system: - $ref: '#/components/schemas/ConfigSystem' - footer: - $ref: '#/components/schemas/ConfigFooter' - security: - $ref: '#/components/schemas/ConfigSecurity' + email: + type: string Sign: type: object properties: @@ -4150,41 +609,6 @@ components: award: type: integer format: int32 - Stats: - type: object - properties: - userCount: - type: integer - format: int64 - documentCount: - type: integer - format: int64 - categoryCount: - type: integer - format: int64 - articleCount: - type: integer - format: int64 - commentCount: - type: integer - format: int64 - bannerCount: - type: integer - format: int64 - friendlinkCount: - type: integer - format: int64 - os: - type: string - version: - type: string - hash: - type: string - buildAt: - type: string - reportCount: - type: integer - format: int64 Status: type: object properties: @@ -4201,17 +625,6 @@ components: $ref: '#/components/schemas/GoogleProtobufAny' description: A list of messages that carry the error details. There is a common set of message types for APIs to use. description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' - UpdateGroupPermissionRequest: - type: object - properties: - groupId: - type: integer - format: int64 - permissionId: - type: array - items: - type: integer - format: int64 UpdateUserPasswordRequest: type: object properties: @@ -4285,19 +698,4 @@ components: type: integer format: int32 tags: - - name: ArticleAPI - - name: AttachmentAPI - description: 附件服务。只有管理员才有权限操作 - - name: BannerAPI - - name: CategoryAPI - - name: CommentAPI - - name: ConfigAPI - - name: DocumentAPI - - name: FavoriteAPI - - name: FriendlinkAPI - - name: GroupAPI - - name: HealthAPI - - name: PermissionAPI - - name: RecycleAPI - - name: ReportAPI - name: UserAPI