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

Protocol Documentation

Table of Contents

Top

api/v1/user.proto

DeleteUserRequest

Field Type Label Description
id int64 repeated

Dynamic

Field Type Label Description
id int64
user_id int64
content string
type int32 类型
username string
created_at google.protobuf.Timestamp
updated_at google.protobuf.Timestamp

FindPasswordRequest

Field Type Label Description
email string
token string
password string
captcha string
captcha_id string

GetUserCaptchaReply

Field Type Label Description
enable bool
id string
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

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
group_id int64 repeated
status int32 repeated
limit int64

LoginReply

Field Type Label Description
token string
user User

RegisterAndLoginRequest

Field Type Label Description
username string
password string
captcha string
captcha_id string
email string

SetUserRequest

Field Type Label Description
id int64
username string
password string
group_id int64 repeated
email string

Sign

Field Type Label Description
id int64
user_id int64
sign_at int32
ip string
created_at google.protobuf.Timestamp
award int32 签到积分奖励

UpdateUserPasswordRequest

修改用户密码

Field Type Label Description
id int64
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
username string
mobile string
email string
address string
signature string
last_login_ip string
register_ip string
doc_count int32
follow_count int32
fans_count int32
favorite_count int32
comment_count int32
status int32
avatar string
identity string
realname string
group_id int64 repeated
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)