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.
66 KiB
66 KiB
Protocol Documentation
Table of Contents
api/v1/article.proto
Article
文章
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 文章ID | |
identifier | string | 文章唯一标识 | |
author | string | 文章作者。如果为空,则使用网站名称作为作者 | |
view_count | int64 | 文章浏览次数 | |
title | string | 文章标题 | |
keywords | string | 文章关键字 | |
description | string | 文章描述 | |
content | string | 文章内容 | |
created_at | google.protobuf.Timestamp | 文章创建时间 | |
updated_at | google.protobuf.Timestamp | 文章更新时间 |
DeleteArticleRequest
删除文章请求,传入单个或者多个文章ID
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
GetArticleRequest
根据ID或者文章标识获取文章,二选一
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 文章ID | |
identifier | string | 文章唯一标识 |
ListArticleReply
文章列表响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | 文章总数 | |
article | Article | repeated | 文章列表 |
ListArticleRequest
文章列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | 页码 | |
size | int64 | 每页数量 | |
wd | string | 搜索关键字 | |
field | string | repeated | 查询字段 |
order | string | 排序字段,根据指定的字段倒序排序 |
ArticleAPI
文章API服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateArticle | Article | .google.protobuf.Empty | 创建文章 |
UpdateArticle | Article | .google.protobuf.Empty | 更新文章 |
DeleteArticle | DeleteArticleRequest | .google.protobuf.Empty | 删除文章 |
GetArticle | GetArticleRequest | Article | 获取文章 |
ListArticle | ListArticleRequest | ListArticleReply | 文章列表 |
api/v1/attachment.proto
Attachment
附件
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 附件ID | |
hash | string | 附件哈希值,MD5 | |
user_id | int64 | 上传用户ID | |
type_id | int64 | 附件类型ID,如果是文档类型,则为文档ID | |
type | int32 | 附件类型,见 web/utils/enum.js | |
enable | bool | 是否启用 | |
path | string | 附件路径 | |
name | string | 附件名称 | |
size | int64 | 附件大小,单位:字节 | |
width | int64 | 附件宽度,单位:像素。针对图片附件 | |
height | int64 | 附件高度,单位:像素。针对图片附件 | |
ext | string | 扩展名,如:.docx | |
ip | string | 上传IP地址 | |
username | string | 用户名称 | |
type_name | string | 附件类型名称 | |
description | string | 附件描述、备注 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
DeleteAttachmentRequest
删除附件请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
GetAttachmentRequest
获取附件请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
ListAttachmentReply
列出附件响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | ||
attachment | Attachment | repeated |
ListAttachmentRequest
列出附件请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | 页码 | |
size | int64 | 每页数量 | |
wd | string | 搜索关键字 | |
enable | bool | repeated | 是否启用 |
user_id | int64 | repeated | 用户ID |
type | int64 | repeated | 类型 |
ext | string | 扩展名 |
AttachmentAPI
附件服务。只有管理员才有权限操作
Method Name | Request Type | Response Type | Description |
---|---|---|---|
UpdateAttachment | Attachment | .google.protobuf.Empty | 更新附件 |
DeleteAttachment | DeleteAttachmentRequest | .google.protobuf.Empty | 删除附件。这里只是软删除,不会真正删除附件,默认24小时候会真正清除附件 |
GetAttachment | GetAttachmentRequest | Attachment | 查询附件 |
ListAttachment | ListAttachmentRequest | ListAttachmentReply | 列出附件 |
api/v1/banner.proto
Banner
banner,轮播图
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 主键 | |
title | string | 标题,名称 | |
path | string | 图片地址 | |
sort | int32 | 排序,值越大越靠前 | |
enable | bool | 是否启用 | |
type | int32 | 类型,如PC横幅、小程序横幅等,见 web/utils/enum.js 中的枚举 | |
url | string | 跳转地址 | |
description | string | 描述 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
DeleteBannerRequest
删除横幅
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
GetBannerRequest
获取横幅
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
ListBannerReply
横幅列表
Field | Type | Label | Description |
---|---|---|---|
total | int64 | 总数 | |
banner | Banner | repeated | 横幅数组 |
ListBannerRequest
横幅列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | 页码 | |
size | int64 | 每页数量 | |
type | int32 | repeated | 类型 |
enable | bool | repeated | 是否启用 |
wd | string | 搜索关键字 | |
field | string | repeated | 查询字段,不指定,则查询全部 |
BannerAPI
横幅API服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateBanner | Banner | Banner | 创建横幅 |
UpdateBanner | Banner | .google.protobuf.Empty | 更新横幅 |
DeleteBanner | DeleteBannerRequest | .google.protobuf.Empty | 删除横幅 |
GetBanner | GetBannerRequest | Banner | 查询横幅 |
ListBanner | ListBannerRequest | ListBannerReply | 横幅列表 |
api/v1/category.proto
Category
文档分类
Field | Type | Label | Description |
---|---|---|---|
id | int32 | 分类ID | |
parent_id | int32 | 父分类ID | |
title | string | 分类标题 | |
doc_count | int32 | 文档数量 | |
sort | int32 | 排序,倒序排序,值越大越靠前 | |
enable | bool | 是否启用 | |
cover | string | 分类封面 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
DeleteCategoryRequest
删除分类请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
GetCategoryRequest
获取分类请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
ListCategoryReply
分类列表响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | 总数 | |
category | Category | repeated | 分类列表 |
ListCategoryRequest
分类列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | 页码 | |
size | int64 | 每页数量 | |
parent_id | int64 | repeated | 父分类ID |
wd | string | 搜索关键字 | |
enable | bool | repeated | 是否启用 |
field | string | repeated | 查询字段 |
CategoryAPI
文档分类API服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateCategory | Category | .google.protobuf.Empty | 创建分类 |
UpdateCategory | Category | .google.protobuf.Empty | 更新分类 |
DeleteCategory | DeleteCategoryRequest | .google.protobuf.Empty | 删除分类 |
GetCategory | GetCategoryRequest | Category | 获取分类 |
ListCategory | ListCategoryRequest | ListCategoryReply | 分类列表 |
api/v1/comment.proto
CheckCommentRequest
审核评论,修改评论状态
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated | 评论ID |
status | int32 | 状态,见 web/utils/enum.js 枚举 |
Comment
评论
Field | Type | Label | Description |
---|---|---|---|
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 | |
id | int64 | 评论ID | |
parent_id | int64 | 父评论ID | |
content | string | 评论内容 | |
document_id | int64 | 文档ID | |
status | int32 | 状态,见 web/utils/enum.js 枚举 | |
comment_count | int32 | 回复数量 | |
user_id | int64 | 用户ID | |
user | User | 用户信息 | |
document_title | string | 文档标题 |
CreateCommentRequest
创建评论请求
Field | Type | Label | Description |
---|---|---|---|
document_id | int64 | 文档ID | |
parent_id | int64 | 父评论ID | |
content | string | 评论内容 | |
captcha_id | string | 验证码ID | |
captcha | string | 验证码 |
DeleteCommentRequest
删除评论请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
GetCommentRequest
获取评论请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
ListCommentReply
获取评论列表响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | 总数 | |
comment | Comment | repeated | 评论列表 |
ListCommentRequest
获取评论列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | 页码 | |
size | int64 | 每页数量 | |
wd | string | 搜索关键词 | |
field | string | repeated | 查询的数据字段 |
order | string | 排序字段 | |
status | int32 | repeated | 状态,见 web/utils/enum.js 枚举 |
document_id | int64 | 文档ID | |
user_id | int64 | 用户ID | |
parent_id | int64 | repeated | 父评论ID |
with_document_title | bool | 是否返回文档标题 |
CommentAPI
评论服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateComment | CreateCommentRequest | .google.protobuf.Empty | 创建评论 |
UpdateComment | Comment | .google.protobuf.Empty | 更新评论,仅限管理员操作 |
DeleteComment | DeleteCommentRequest | .google.protobuf.Empty | 管理员或用户自己删除自己的评论 |
GetComment | GetCommentRequest | Comment | 获取单个评论 |
ListComment | ListCommentRequest | ListCommentReply | 获取评论列表 |
CheckComment | CheckCommentRequest | .google.protobuf.Empty | 审核评论 |
api/v1/config.proto
Config
配置
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 配置ID | |
label | string | 配置标签 | |
name | string | 配置名称 | |
value | string | 配置值 | |
placeholder | string | 配置占位符 | |
input_type | string | 输入类型,如:textarea、number、switch等 | |
category | string | 配置分类,如:system、footer、security等,见 web/utils/enum.js | |
sort | int32 | 排序,越小越靠前 | |
options | string | 配置项枚举,一个一行,如select的option选项,用 key=value 的形式 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
ConfigCaptcha
验证码配置
Field | Type | Label | Description |
---|---|---|---|
length | int32 | 验证码长度 | |
width | int32 | 验证码宽度 | |
height | int32 | 验证码高度 | |
type | string | 验证码类型,见 web/utils/enum.js |
ConfigFooter
底链配置项,为跳转的链接地址
Field | Type | Label | Description |
---|---|---|---|
about | string | 关于我们 | |
contact | string | 联系我们 | |
agreement | string | 用户协议、文库协议 | |
copyright | string | 版权声明 | |
feedback | string | 意见和建议反馈 |
ConfigSecurity
安全配置
Field | Type | Label | Description |
---|---|---|---|
is_close | bool | 是否关闭站点 | |
close_statement | string | 关闭站点的说明,支持HTML | |
enable_register | bool | 是否开放注册 | |
enable_captcha_login | bool | 是否开启登录验证码 | |
enable_captcha_register | bool | 是否开启注册验证码 | |
enable_captcha_comment | bool | 是否开启评论验证码 | |
enable_captcha_find_password | bool | 是否开启找回密码验证码 | |
enable_captcha_upload | bool | 是否开启上传验证码 | |
max_document_size | int32 | 文档最大大小 | |
document_allowed_ext | string | repeated | 文档允许的扩展名 |
login_required | bool | 是否登录才能访问 |
ConfigSystem
系统配置项
Field | Type | Label | Description |
---|---|---|---|
domain | string | 站点域名,如: https://moredoc.mnt.ltd | |
title | string | 站点标题,首页显示 | |
keywords | string | 站点关键词,SEO用 | |
description | string | 站点描述,SEO用 | |
logo | string | 站点logo | |
favicon | string | 站点favicon | |
icp | string | 站点备案号 | |
analytics | string | 站点统计代码,目前只支持百度统计 | |
sitename | string | 站点名称 | |
copyright_start_year | string | 站点版权起始年份,如:2018,则底部显示 2018 - 2023 | |
register_background | string | 注册页背景图 | |
login_background | string | 登录页背景图 | |
recommend_words | string | repeated | 推荐搜索词,首页展示 |
version | string | 程序版本号 |
Configs
配置列表
Field | Type | Label | Description |
---|---|---|---|
config | Config | repeated |
EnvDependent
依赖项
Field | Type | Label | Description |
---|---|---|---|
name | string | 依赖名称 | |
description | string | 依赖描述 | |
is_installed | bool | 是否已安装 | |
error | string | 错误信息 | |
checked_at | google.protobuf.Timestamp | 检测时间 | |
cmd | string | 检测命令 | |
is_required | bool | 是否必须 |
Envs
依赖项列表
Field | Type | Label | Description |
---|---|---|---|
envs | EnvDependent | repeated |
ListConfigRequest
查询配置项请求
Field | Type | Label | Description |
---|---|---|---|
category | string | repeated |
Settings
系统配置
Field | Type | Label | Description |
---|---|---|---|
system | ConfigSystem | 系统配置 | |
footer | ConfigFooter | 底链配置 | |
security | ConfigSecurity | 安全配置 |
Stats
系统状态
Field | Type | Label | Description |
---|---|---|---|
user_count | int64 | 用户数量 | |
document_count | int64 | 文档数量 | |
category_count | int64 | 分类数量 | |
article_count | int64 | 文章数量 | |
comment_count | int64 | 评论数量 | |
banner_count | int64 | banner数量 | |
friendlink_count | int64 | 友情链接数量 | |
os | string | 操作系统 | |
version | string | 程序版本号 | |
hash | string | 程序构建时的 git hash | |
build_at | string | 程序构建时间 | |
report_count | int64 | 举报数量 |
ConfigAPI
配置服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
GetSettings | .google.protobuf.Empty | Settings | 获取系统配置(针对所有用户,只读) |
UpdateConfig | Configs | .google.protobuf.Empty | UpdateConfig 更新配置 |
ListConfig | ListConfigRequest | Configs | ListConfig 查询配置项 |
GetStats | .google.protobuf.Empty | Stats | 获取系统配置 |
GetEnvs | .google.protobuf.Empty | Envs | 获取系统环境依赖检测 |
UpdateSitemap | .google.protobuf.Empty | .google.protobuf.Empty | 更新站点地图 |
api/v1/document.proto
CreateDocumentItem
创建文档
Field | Type | Label | Description |
---|---|---|---|
title | string | 文档标题 | |
attachment_id | int64 | 文档附件ID | |
price | int32 | 文档价格 |
CreateDocumentRequest
创建文档
Field | Type | Label | Description |
---|---|---|---|
overwrite | bool | 是否覆盖。暂时用不到 | |
category_id | int64 | repeated | 文档分类ID |
document | CreateDocumentItem | repeated | 文档列表 |
DeleteDocumentRequest
删除文档,放入回收站
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
Document
文档
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 文档ID | |
title | string | 文档标题 | |
keywords | string | 文档关键字 | |
description | string | 文档描述 | |
user_id | int64 | 文档作者 | |
cover | string | 文档封面 | |
width | int32 | 文档宽度 | |
height | int32 | 文档高度 | |
preview | int32 | 文档可预览页数,0表示不限制 | |
pages | int32 | 文档页数 | |
uuid | string | 文档UUID | |
download_count | int32 | 文档下载次数 | |
view_count | int32 | 文档浏览次数 | |
favorite_count | int32 | 文档收藏次数 | |
comment_count | int32 | 文档评论次数 | |
score | int32 | 文档评分 | |
score_count | int32 | 文档评分次数 | |
price | int32 | 文档价格 | |
size | int64 | 文档大小 | |
status | int32 | 文档状态,见 web/utils/enum.js | |
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 | 文档分类ID |
deleted_username | string | 删除文档的用户名 | |
ext | string | 文档扩展名 | |
attachment | Attachment | 文档附件 | |
user | User | 文档作者 | |
enable_gzip | bool | 是否启用gzip压缩 | |
convert_error | string | 转换错误信息 |
DocumentScore
文档评分
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 评分ID | |
document_id | int64 | 文档ID | |
user_id | int64 | 用户ID | |
score | int32 | 评分,100~500,100为1分,500为5分 | |
created_at | google.protobuf.Timestamp | 评分时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
DownloadDocumentReply
文档下载
Field | Type | Label | Description |
---|---|---|---|
url | string |
GetDocumentRequest
查询文档
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 文档ID | |
with_author | bool | 是否查询作者信息 |
ListDocumentForHomeItem
首页文档查询返回项
Field | Type | Label | Description |
---|---|---|---|
category_id | int64 | 分类ID | |
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 | 分类ID |
user_id | int64 | repeated | 用户ID |
status | int32 | repeated | 文档状态 |
is_recommend | bool | repeated | 是否推荐 |
limit | int64 | 查询数量显示。当该值大于0时,page和size无效 |
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 | 文档ID |
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 | 根据文档ID查询当前文档的相关文档 |
DownloadDocument | Document | DownloadDocumentReply | 根据文档ID,获取文档下载链接 |
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 | 清空回收站文档 |
api/v1/favorite.proto
DeleteFavoriteRequest
取消收藏
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
Favorite
文档收藏
Field | Type | Label | Description |
---|---|---|---|
id | int64 | ||
user_id | int64 | ||
document_id | int64 | ||
title | string | ||
ext | string | ||
score | int32 | ||
size | int64 | ||
pages | int32 | ||
created_at | google.protobuf.Timestamp | ||
updated_at | google.protobuf.Timestamp |
GetFavoriteRequest
根据文章id,查询用户是否有收藏某篇文档
Field | Type | Label | Description |
---|---|---|---|
document_id | int64 |
ListFavoriteReply
查询用户的收藏
Field | Type | Label | Description |
---|---|---|---|
total | int64 | ||
favorite | Favorite | repeated |
ListFavoriteRequest
查询用户的收藏
Field | Type | Label | Description |
---|---|---|---|
page | int64 | ||
size | int64 | ||
user_id | int64 |
FavoriteAPI
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateFavorite | Favorite | Favorite | 添加收藏 |
DeleteFavorite | DeleteFavoriteRequest | .google.protobuf.Empty | 取消收藏 |
GetFavorite | GetFavoriteRequest | Favorite | 根据文章id,查询用户是否有收藏某篇文档 |
ListFavorite | ListFavoriteRequest | ListFavoriteReply | 查询用户的收藏 |
api/v1/friendlink.proto
DeleteFriendlinkRequest
删除友情链接
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
Friendlink
友情链接
Field | Type | Label | Description |
---|---|---|---|
id | int32 | 主键 | |
title | string | 标题 | |
link | string | 链接 | |
description | string | 描述 | |
sort | int32 | 排序 | |
enable | bool | 是否启用 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
GetFriendlinkRequest
获取友情链接
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
ListFriendlinkReply
友情链接列表
Field | Type | Label | Description |
---|---|---|---|
friendlink | Friendlink | repeated | |
total | int64 |
ListFriendlinkRequest
友情链接列表
Field | Type | Label | Description |
---|---|---|---|
page | int32 | ||
size | int32 | ||
wd | string | ||
enable | bool | repeated | |
field | string | repeated |
FriendlinkAPI
友情链接服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateFriendlink | Friendlink | Friendlink | 创建友情链接 |
UpdateFriendlink | Friendlink | .google.protobuf.Empty | 更新友情链接 |
DeleteFriendlink | DeleteFriendlinkRequest | .google.protobuf.Empty | 删除友情链接 |
GetFriendlink | GetFriendlinkRequest | Friendlink | 获取友情链接 |
ListFriendlink | ListFriendlinkRequest | ListFriendlinkReply | 获取友情链接 |
api/v1/group.proto
DeleteGroupRequest
删除用户组,可以批量删除
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
GetGroupPermissionRequest
获取用户组权限
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
GetGroupRequest
根据组名或者ID获取用户组
Field | Type | Label | Description |
---|---|---|---|
id | int64 | ||
title | string |
Group
用户组,角色
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 用户组ID | |
title | string | 用户组名称 | |
color | string | 用户组颜色 | |
is_default | bool | 是否是默认用户组 | |
is_display | bool | 是否显示 | |
description | string | 用户组描述 | |
user_count | int32 | 用户组下的用户数量 | |
sort | int32 | 排序 | |
enable_upload | bool | 是否允许上传文档 | |
enable_comment_approval | bool | 是否需要审核评论 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
GroupPermissions
用户组权限
Field | Type | Label | Description |
---|---|---|---|
permission_id | int64 | repeated |
ListGroupReply
用户组列表
Field | Type | Label | Description |
---|---|---|---|
group | Group | repeated | |
total | int64 |
ListGroupRequest
查询用户组列表。不需要分页,直接返回全部用户组,只是可以指定查询哪些字段
Field | Type | Label | Description |
---|---|---|---|
wd | string | ||
page | int64 | ||
size | int64 | ||
sort | string | ||
field | string | repeated |
UpdateGroupPermissionRequest
更新用户组权限
Field | Type | Label | Description |
---|---|---|---|
group_id | int64 | ||
permission_id | int64 | repeated |
GroupAPI
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateGroup | Group | Group | 创建用户组 |
UpdateGroup | Group | .google.protobuf.Empty | 更新用户组 |
DeleteGroup | DeleteGroupRequest | .google.protobuf.Empty | 删除用户组 |
GetGroup | GetGroupRequest | Group | 获取用户组 |
ListGroup | ListGroupRequest | ListGroupReply | 获取用户组列表 |
GetGroupPermission | GetGroupPermissionRequest | GroupPermissions | 获取用户组权限列表 |
UpdateGroupPermission | UpdateGroupPermissionRequest | .google.protobuf.Empty | 更新用户组权限,给用户组设置权限 |
api/v1/health.proto
PingRequest
Field | Type | Label | Description |
---|---|---|---|
name | string |
PongReply
Field | Type | Label | Description |
---|---|---|---|
name | string | ||
created_at | google.protobuf.Timestamp |
HealthAPI
Method Name | Request Type | Response Type | Description |
---|---|---|---|
Health | .google.protobuf.Empty | .google.protobuf.Empty | |
Ping | .PingRequest | .PongReply |
api/v1/permission.proto
GetPermissionReply
权限响应
Field | Type | Label | Description |
---|---|---|---|
permission | Permission |
GetPermissionRequest
权限请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
ListPermissionReply
权限列表响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | ||
permission | Permission | repeated |
ListPermissionRequest
权限列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | ||
size | int64 | ||
wd | string | ||
method | string | repeated | |
path | string |
Permission
权限
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 权限ID | |
method | string | 请求方法 | |
path | string | 请求路径 | |
title | string | 权限名称 | |
description | string | 权限描述 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
PermissionAPI
权限API服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
UpdatePermission | Permission | .google.protobuf.Empty | 更新权限信息。这里只能操作title和description |
GetPermission | GetPermissionRequest | Permission | 查询权限信息 |
ListPermission | ListPermissionRequest | ListPermissionReply | 查询权限列表 |
api/v1/report.proto
DeleteReportRequest
删除举报请求
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
ListReportReply
举报列表响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | ||
report | Report | repeated |
ListReportRequest
举报列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | ||
size | int64 | ||
wd | string | ||
field | string | repeated | |
order | string | ||
status | bool | repeated |
Report
举报
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 举报ID | |
document_id | int64 | 文档ID | |
user_id | int64 | 举报人ID | |
reason | int32 | 举报原因 | |
status | bool | 举报处理状态 | |
created_at | google.protobuf.Timestamp | 举报时间 | |
updated_at | google.protobuf.Timestamp | 处理时间 | |
document_title | string | 文档标题 | |
remark | string | 处理备注 | |
username | string | 举报人 |
ReportAPI
举报服务
Method Name | Request Type | Response Type | Description |
---|---|---|---|
CreateReport | Report | .google.protobuf.Empty | 创建举报 |
UpdateReport | Report | .google.protobuf.Empty | 更新举报,审核举报内容 |
DeleteReport | DeleteReportRequest | .google.protobuf.Empty | 删除举报 |
ListReport | ListReportRequest | ListReportReply | 获取举报列表 |
api/v1/user.proto
DeleteUserRequest
删除用户
Field | Type | Label | Description |
---|---|---|---|
id | int64 | repeated |
Dynamic
用户动态
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 动态ID | |
user_id | int64 | 用户ID | |
content | string | 内容 | |
type | int32 | 类型 | |
username | string | 用户名 | |
created_at | google.protobuf.Timestamp | 创建时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 |
FindPasswordRequest
找回密码
Field | Type | Label | Description |
---|---|---|---|
string | 邮箱 | ||
token | string | 签名token | |
password | string | 新密码 | |
captcha | string | 验证码 | |
captcha_id | string | 验证码ID |
GetUserCaptchaReply
验证码响应
Field | Type | Label | Description |
---|---|---|---|
enable | bool | 是否启用验证码 | |
id | string | 验证码ID | |
captcha | string | 验证码 | |
type | string | 验证码类型 |
GetUserCaptchaRequest
查询验证码请求
Field | Type | Label | Description |
---|---|---|---|
type | string | 验证码类型:register、login、comment、find_password、upload |
GetUserPermissionsReply
用户权限信息查询
Field | Type | Label | Description |
---|---|---|---|
permission | Permission | repeated |
GetUserRequest
获取用户信息
Field | Type | Label | Description |
---|---|---|---|
id | int64 |
ListUserDynamicReply
用户动态列表响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | 总数 | |
dynamic | Dynamic | repeated | 动态列表 |
ListUserDynamicRequest
用户动态列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | 页码 | |
size | int64 | 每页数量 | |
id | int64 | 用户ID |
ListUserReply
用户列表响应
Field | Type | Label | Description |
---|---|---|---|
total | int64 | 总数 | |
user | User | repeated | 用户列表 |
ListUserRequest
用户列表请求
Field | Type | Label | Description |
---|---|---|---|
page | int64 | 页码 | |
size | int64 | 每页数量 | |
wd | string | 搜索关键词 | |
sort | string | 排序字段 | |
id | int64 | repeated | 用户ID |
group_id | int64 | repeated | 用户组ID |
status | int32 | repeated | 用户状态 |
limit | int64 | 请求数量限制,大于0时,page和size无效 |
LoginReply
用户登录响应
Field | Type | Label | Description |
---|---|---|---|
token | string | ||
user | User |
RegisterAndLoginRequest
用户注册登录请求
Field | Type | Label | Description |
---|---|---|---|
username | string | 用户名 | |
password | string | 密码 | |
captcha | string | 验证码 | |
captcha_id | string | 验证码ID | |
string | 邮箱 |
SetUserRequest
管理后台设置用户信息
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 用户ID | |
username | string | 用户名 | |
password | string | 密码 | |
group_id | int64 | repeated | 用户组ID |
string | 邮箱 |
Sign
用户签到
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 签到ID | |
user_id | int64 | 用户ID | |
sign_at | int32 | 签到日期 | |
ip | string | 签到IP | |
created_at | google.protobuf.Timestamp | 创建时间 | |
award | int32 | 签到积分奖励 |
UpdateUserPasswordRequest
修改用户密码
Field | Type | Label | Description |
---|---|---|---|
id | int64 | 用户ID | |
old_password | string | 旧密码 | |
new_password | string | 新密码 |
User
用户信息
Field | Type | Label | Description |
---|---|---|---|
login_at | google.protobuf.Timestamp | 最后登录时间 | |
created_at | google.protobuf.Timestamp | 注册时间 | |
updated_at | google.protobuf.Timestamp | 更新时间 | |
id | int64 | 用户ID | |
username | string | 用户名 | |
mobile | string | 手机号 | |
string | 邮箱,唯一 | ||
address | string | 地址 | |
signature | string | 个性签名 | |
last_login_ip | string | 最后登录IP | |
register_ip | string | 注册IP | |
doc_count | int32 | 文档数量 | |
follow_count | int32 | 关注数量 | |
fans_count | int32 | 粉丝数量 | |
favorite_count | int32 | 收藏数量 | |
comment_count | int32 | 评论数量 | |
status | int32 | 用户状态,见 web/utils/enum.js,当前没有使用 | |
avatar | string | 头像 | |
identity | string | 身份证 | |
realname | string | 真实姓名 | |
group_id | int64 | repeated | 用户组ID |
credit_count | int32 | 积分 |
UserAPI
Method Name | Request Type | Response Type | Description |
---|---|---|---|
Register | RegisterAndLoginRequest | LoginReply | 用户注册 |
Login | RegisterAndLoginRequest | LoginReply | 用户登录 |
Logout | .google.protobuf.Empty | .google.protobuf.Empty | 退出登录 |
GetUser | GetUserRequest | User | 查询用户信息。如果传递了Id参数,则表示查询用户的公开信息,否则查询当前用户的私有信息 |
UpdateUserPassword | UpdateUserPasswordRequest | .google.protobuf.Empty | 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 |
UpdateUserProfile | User | .google.protobuf.Empty | 更新用户密码。如果不传用户ID,则表示更新当前用户的密码; 如果穿了用户ID,则表示更新指定用户的密码,这时需要验证当前用户的权限 |
DeleteUser | DeleteUserRequest | .google.protobuf.Empty | 删除用户。需要验证用户权限 |
AddUser | SetUserRequest | .google.protobuf.Empty | 新增用户 |
SetUser | SetUserRequest | .google.protobuf.Empty | 设置用户 |
ListUser | ListUserRequest | ListUserReply | 查询用户列表。对于非管理员,返回相应用户的公开信息; 对于管理员,返回相应用户的绝大部分信息 |
GetUserCaptcha | GetUserCaptchaRequest | GetUserCaptchaReply | GetUserCaptcha 获取用户验证码 |
GetUserPermissions | .google.protobuf.Empty | GetUserPermissionsReply | GetUserCaptcha 获取用户验证码 |
CanIUploadDocument | .google.protobuf.Empty | .google.protobuf.Empty | 用户是否可以上传文档 |
ListUserDynamic | ListUserDynamicRequest | ListUserDynamicReply | 获取用户动态,包括获取关注的用户的动态 |
SignToday | .google.protobuf.Empty | Sign | 每日签到 |
GetSignedToday | .google.protobuf.Empty | Sign | 获取今日已签到记录 |
FindPasswordStepOne | FindPasswordRequest | .google.protobuf.Empty | 找回密码:第一步,发送验证码 |
FindPasswordStepTwo | FindPasswordRequest | .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) |