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