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.

10 KiB

Protocol Documentation

Table of Contents

Top

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 更新站点地图

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)