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.

8.9 KiB

Protocol Documentation

Table of Contents

Top

api/v1/config.proto

Config

Field Type Label Description
id int64
label string
name string
value string
placeholder string
input_type string
category string
sort int32
options string
created_at google.protobuf.Timestamp
updated_at google.protobuf.Timestamp

ConfigCaptcha

验证码配置

Field Type Label Description
length int32
width int32
height int32
type string

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
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
title string
keywords string
description string
logo string
favicon string
icp string
analytics string
sitename string
copyright_start_year string
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 ConfigCaptcha captcha = 4;

Stats

Field Type Label Description
user_count int64
document_count int64
category_count int64
article_count int64
comment_count int64
banner_count int64
friendlink_count int64
os string
version string
hash string
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)