dev
truthhun 1 year ago
parent 6768cb1535
commit 568b6a07f7

@ -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)
}

@ -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',

@ -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)
}

@ -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; // IDID
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',

@ -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)
}

@ -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',

File diff suppressed because it is too large Load Diff

@ -0,0 +1,158 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_article-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/article.proto
<a name="api-v1-Article"></a>
### 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) | | 文章更新时间 |
<a name="api-v1-DeleteArticleRequest"></a>
### DeleteArticleRequest
删除文章请求传入单个或者多个文章ID
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetArticleRequest"></a>
### GetArticleRequest
根据ID或者文章标识获取文章二选一
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | 文章ID |
| identifier | [string](#string) | | 文章唯一标识 |
<a name="api-v1-ListArticleReply"></a>
### ListArticleReply
文章列表响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | 文章总数 |
| article | [Article](#api-v1-Article) | repeated | 文章列表 |
<a name="api-v1-ListArticleRequest"></a>
### ListArticleRequest
文章列表请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | 页码 |
| size | [int64](#int64) | | 每页数量 |
| wd | [string](#string) | | 搜索关键字 |
| field | [string](#string) | repeated | 查询字段 |
| order | [string](#string) | | 排序字段,根据指定的字段倒序排序 |
<a name="api-v1-ArticleAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,168 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_attachment-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/attachment.proto
<a name="api-v1-Attachment"></a>
### 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) | | 更新时间 |
<a name="api-v1-DeleteAttachmentRequest"></a>
### DeleteAttachmentRequest
删除附件请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetAttachmentRequest"></a>
### GetAttachmentRequest
获取附件请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-ListAttachmentReply"></a>
### ListAttachmentReply
列出附件响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| attachment | [Attachment](#api-v1-Attachment) | repeated | |
<a name="api-v1-ListAttachmentRequest"></a>
### 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) | | 扩展名 |
<a name="api-v1-AttachmentAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,158 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_banner-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/banner.proto
<a name="api-v1-Banner"></a>
### 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) | | 更新时间 |
<a name="api-v1-DeleteBannerRequest"></a>
### DeleteBannerRequest
删除横幅
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetBannerRequest"></a>
### GetBannerRequest
获取横幅
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-ListBannerReply"></a>
### ListBannerReply
横幅列表
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | 总数 |
| banner | [Banner](#api-v1-Banner) | repeated | 横幅数组 |
<a name="api-v1-ListBannerRequest"></a>
### 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 | 查询字段,不指定,则查询全部 |
<a name="api-v1-BannerAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,157 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_category-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/category.proto
<a name="api-v1-Category"></a>
### 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) | | |
<a name="api-v1-DeleteCategoryRequest"></a>
### DeleteCategoryRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetCategoryRequest"></a>
### GetCategoryRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-ListCategoryReply"></a>
### ListCategoryReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| category | [Category](#api-v1-Category) | repeated | |
<a name="api-v1-ListCategoryRequest"></a>
### 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 | |
<a name="api-v1-CategoryAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,201 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_comment-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/comment.proto
<a name="api-v1-CheckCommentRequest"></a>
### CheckCommentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
| status | [int32](#int32) | | |
<a name="api-v1-Comment"></a>
### 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) | | |
<a name="api-v1-CreateCommentRequest"></a>
### CreateCommentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| document_id | [int64](#int64) | | |
| parent_id | [int64](#int64) | | |
| content | [string](#string) | | |
| captcha_id | [string](#string) | | |
| captcha | [string](#string) | | |
<a name="api-v1-DeleteCommentRequest"></a>
### DeleteCommentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetCommentRequest"></a>
### GetCommentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-ListCommentReply"></a>
### ListCommentReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| comment | [Comment](#api-v1-Comment) | repeated | |
<a name="api-v1-ListCommentRequest"></a>
### 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) | | |
<a name="api-v1-CommentAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,299 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_config-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/config.proto
<a name="api-v1-Config"></a>
### 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) | | |
<a name="api-v1-ConfigCaptcha"></a>
### ConfigCaptcha
验证码配置
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| length | [int32](#int32) | | |
| width | [int32](#int32) | | |
| height | [int32](#int32) | | |
| type | [string](#string) | | |
<a name="api-v1-ConfigFooter"></a>
### ConfigFooter
底链配置项
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| about | [string](#string) | | |
| contact | [string](#string) | | |
| agreement | [string](#string) | | |
| copyright | [string](#string) | | |
| feedback | [string](#string) | | |
<a name="api-v1-ConfigSecurity"></a>
### 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) | | 是否登录才能访问 |
<a name="api-v1-ConfigSystem"></a>
### 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) | | 程序版本号 |
<a name="api-v1-Configs"></a>
### Configs
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| config | [Config](#api-v1-Config) | repeated | |
<a name="api-v1-EnvDependent"></a>
### 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) | | 是否必须 |
<a name="api-v1-Envs"></a>
### Envs
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| envs | [EnvDependent](#api-v1-EnvDependent) | repeated | |
<a name="api-v1-ListConfigRequest"></a>
### ListConfigRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| category | [string](#string) | repeated | |
<a name="api-v1-Settings"></a>
### Settings
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| system | [ConfigSystem](#api-v1-ConfigSystem) | | |
| footer | [ConfigFooter](#api-v1-ConfigFooter) | | |
| security | [ConfigSecurity](#api-v1-ConfigSecurity) | | ConfigCaptcha captcha = 4; |
<a name="api-v1-Stats"></a>
### 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) | | |
<a name="api-v1-ConfigAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,404 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_document-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/document.proto
<a name="api-v1-CreateDocumentItem"></a>
### CreateDocumentItem
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| title | [string](#string) | | |
| attachment_id | [int64](#int64) | | |
| price | [int32](#int32) | | |
<a name="api-v1-CreateDocumentRequest"></a>
### CreateDocumentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| overwrite | [bool](#bool) | | |
| category_id | [int64](#int64) | repeated | |
| document | [CreateDocumentItem](#api-v1-CreateDocumentItem) | repeated | |
<a name="api-v1-DeleteDocumentRequest"></a>
### DeleteDocumentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-Document"></a>
### 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) | | |
<a name="api-v1-DocumentScore"></a>
### 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) | | |
<a name="api-v1-DownloadDocumentReply"></a>
### DownloadDocumentReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| url | [string](#string) | | |
<a name="api-v1-GetDocumentRequest"></a>
### GetDocumentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| with_author | [bool](#bool) | | |
<a name="api-v1-ListDocumentForHomeItem"></a>
### ListDocumentForHomeItem
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| category_id | [int64](#int64) | | |
| category_cover | [string](#string) | | |
| category_name | [string](#string) | | |
| document | [Document](#api-v1-Document) | repeated | |
<a name="api-v1-ListDocumentForHomeRequest"></a>
### ListDocumentForHomeRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| limit | [int64](#int64) | | |
<a name="api-v1-ListDocumentForHomeResponse"></a>
### ListDocumentForHomeResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| document | [ListDocumentForHomeItem](#api-v1-ListDocumentForHomeItem) | repeated | |
<a name="api-v1-ListDocumentReply"></a>
### ListDocumentReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| document | [Document](#api-v1-Document) | repeated | |
<a name="api-v1-ListDocumentRequest"></a>
### 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) | | |
<a name="api-v1-RecoverRecycleDocumentRequest"></a>
### RecoverRecycleDocumentRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-SearchDocumentReply"></a>
### SearchDocumentReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| spend | [string](#string) | | 搜索耗时 |
| document | [Document](#api-v1-Document) | repeated | |
<a name="api-v1-SearchDocumentRequest"></a>
### 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) | | 类型 |
<a name="api-v1-SetDocumentRecommendRequest"></a>
### SetDocumentRecommendRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
| type | [int32](#int32) | | 0, 取消推荐1:推荐 2:重新推荐 |
<a name="api-v1-DocumentAPI"></a>
### 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) | 将文档一键设置为重转 |
<a name="api-v1-RecycleAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,154 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_favorite-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/favorite.proto
<a name="api-v1-DeleteFavoriteRequest"></a>
### DeleteFavoriteRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-Favorite"></a>
### 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) | | |
<a name="api-v1-GetFavoriteRequest"></a>
### GetFavoriteRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| document_id | [int64](#int64) | | |
<a name="api-v1-ListFavoriteReply"></a>
### ListFavoriteReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| favorite | [Favorite](#api-v1-Favorite) | repeated | |
<a name="api-v1-ListFavoriteRequest"></a>
### ListFavoriteRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| user_id | [int64](#int64) | | |
<a name="api-v1-FavoriteAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,155 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_friendlink-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/friendlink.proto
<a name="api-v1-DeleteFriendlinkRequest"></a>
### DeleteFriendlinkRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-Friendlink"></a>
### 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) | | |
<a name="api-v1-GetFriendlinkRequest"></a>
### GetFriendlinkRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-ListFriendlinkReply"></a>
### ListFriendlinkReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| friendlink | [Friendlink](#api-v1-Friendlink) | repeated | |
| total | [int64](#int64) | | |
<a name="api-v1-ListFriendlinkRequest"></a>
### ListFriendlinkRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int32](#int32) | | |
| size | [int32](#int32) | | |
| wd | [string](#string) | | |
| enable | [bool](#bool) | repeated | |
| field | [string](#string) | repeated | |
<a name="api-v1-FriendlinkAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,211 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_group-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/group.proto
<a name="api-v1-DeleteGroupRequest"></a>
### DeleteGroupRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetGroupPermissionRequest"></a>
### GetGroupPermissionRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-GetGroupRequest"></a>
### GetGroupRequest
根据组名或者ID获取用户组
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| title | [string](#string) | | |
<a name="api-v1-Group"></a>
### 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) | | |
<a name="api-v1-GroupPermissions"></a>
### GroupPermissions
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission_id | [int64](#int64) | repeated | |
<a name="api-v1-ListGroupReply"></a>
### ListGroupReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| group | [Group](#api-v1-Group) | repeated | |
| total | [int64](#int64) | | |
<a name="api-v1-ListGroupRequest"></a>
### ListGroupRequest
查询用户组列表。不需要分页,直接返回全部用户组,只是可以指定查询哪些字段
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| wd | [string](#string) | | |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| sort | [string](#string) | | |
| field | [string](#string) | repeated | |
<a name="api-v1-UpdateGroupPermissionRequest"></a>
### UpdateGroupPermissionRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| group_id | [int64](#int64) | | |
| permission_id | [int64](#int64) | repeated | |
<a name="api-v1-GroupAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,93 @@
# Protocol Documentation
<a name="top"></a>
## Table of Contents
- [api/v1/health.proto](#api_v1_health-proto)
- [PingRequest](#-PingRequest)
- [PongReply](#-PongReply)
- [HealthAPI](#-HealthAPI)
- [Scalar Value Types](#scalar-value-types)
<a name="api_v1_health-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/health.proto
<a name="-PingRequest"></a>
### PingRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | |
<a name="-PongReply"></a>
### PongReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
<a name="-HealthAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,168 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_permission-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/permission.proto
<a name="api-v1-DeletePermissionRequest"></a>
### DeletePermissionRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetPermissionReply"></a>
### GetPermissionReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission | [Permission](#api-v1-Permission) | | |
<a name="api-v1-GetPermissionRequest"></a>
### GetPermissionRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-ListPermissionReply"></a>
### ListPermissionReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| permission | [Permission](#api-v1-Permission) | repeated | |
<a name="api-v1-ListPermissionRequest"></a>
### ListPermissionRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| wd | [string](#string) | | |
| method | [string](#string) | repeated | |
| path | [string](#string) | | |
<a name="api-v1-Permission"></a>
### 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) | | |
<a name="api-v1-PermissionAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,141 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_report-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/report.proto
<a name="api-v1-DeleteReportRequest"></a>
### DeleteReportRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-ListReportReply"></a>
### ListReportReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| report | [Report](#api-v1-Report) | repeated | |
<a name="api-v1-ListReportRequest"></a>
### 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 | |
<a name="api-v1-Report"></a>
### 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) | | |
<a name="api-v1-ReportAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

@ -0,0 +1,409 @@
# Protocol Documentation
<a name="top"></a>
## 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)
<a name="api_v1_user-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/v1/user.proto
<a name="api-v1-DeleteUserRequest"></a>
### DeleteUserRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-Dynamic"></a>
### 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) | | |
<a name="api-v1-FindPasswordRequest"></a>
### FindPasswordRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| email | [string](#string) | | |
| token | [string](#string) | | |
| password | [string](#string) | | |
| captcha | [string](#string) | | |
| captcha_id | [string](#string) | | |
<a name="api-v1-GetUserCaptchaReply"></a>
### GetUserCaptchaReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| enable | [bool](#bool) | | |
| id | [string](#string) | | |
| captcha | [string](#string) | | |
| type | [string](#string) | | |
<a name="api-v1-GetUserCaptchaRequest"></a>
### GetUserCaptchaRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [string](#string) | | 验证码类型register、login、comment、find_password、upload |
<a name="api-v1-GetUserPermissionsReply"></a>
### GetUserPermissionsReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission | [Permission](#api-v1-Permission) | repeated | |
<a name="api-v1-GetUserRequest"></a>
### GetUserRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
<a name="api-v1-ListUserDynamicReply"></a>
### ListUserDynamicReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| dynamic | [Dynamic](#api-v1-Dynamic) | repeated | |
<a name="api-v1-ListUserDynamicRequest"></a>
### ListUserDynamicRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| id | [int64](#int64) | | |
<a name="api-v1-ListUserReply"></a>
### ListUserReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| user | [User](#api-v1-User) | repeated | |
<a name="api-v1-ListUserRequest"></a>
### 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) | | |
<a name="api-v1-LoginReply"></a>
### LoginReply
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token | [string](#string) | | |
| user | [User](#api-v1-User) | | |
<a name="api-v1-RegisterAndLoginRequest"></a>
### RegisterAndLoginRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| username | [string](#string) | | |
| password | [string](#string) | | |
| captcha | [string](#string) | | |
| captcha_id | [string](#string) | | |
| email | [string](#string) | | |
<a name="api-v1-SetUserRequest"></a>
### SetUserRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| username | [string](#string) | | |
| password | [string](#string) | | |
| group_id | [int64](#int64) | repeated | |
| email | [string](#string) | | |
<a name="api-v1-Sign"></a>
### 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) | | 签到积分奖励 |
<a name="api-v1-UpdateUserPasswordRequest"></a>
### UpdateUserPasswordRequest
修改用户密码
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| old_password | [string](#string) | | |
| new_password | [string](#string) | | |
<a name="api-v1-User"></a>
### 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) | | |
<a name="api-v1-UserAPI"></a>
### 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 |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> 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) |
| <a name="int64" /> 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 |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> 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) |
| <a name="sint64" /> 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 |
| <a name="fixed32" /> 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) |
| <a name="fixed64" /> 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 |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save