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.
50 lines
1.1 KiB
50 lines
1.1 KiB
// 用户管理
|
|
syntax = "v1"
|
|
|
|
type RegisterRequest {
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
Email string `json:"email,optional"`
|
|
Phone string `json:"phone"`
|
|
Nickname string `json:"nickname,optional"`
|
|
Avatar string `json:"avatar,optional"`
|
|
Role string `json:"role,optional"`
|
|
Status string `json:"status,optional"`
|
|
}
|
|
|
|
type LoginRequest {
|
|
Identity string `json:"identity"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type LogoutRequest {
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type UsersResponse {
|
|
Code int `json:"code"`
|
|
Message string `json:"message"`
|
|
Data interface{} `json:"data"`
|
|
Success bool `json:"success"`
|
|
}
|
|
|
|
@server (
|
|
// jwt: Auth
|
|
// middleware: CheckPermission
|
|
group: user
|
|
)
|
|
// 用户管理
|
|
service usercenter-api {
|
|
@doc "用户注册"
|
|
@handler UserRegisterHandler
|
|
post /register (RegisterRequest) returns (UsersResponse)
|
|
|
|
@doc "用户登录"
|
|
@handler UserLoginHandler
|
|
post /login (LoginRequest) returns (UsersResponse)
|
|
|
|
@doc "用户登出"
|
|
@handler UserLogoutHandler
|
|
post /logout (LogoutRequest) returns (UsersResponse)
|
|
}
|
|
|
|
|