You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/oa/protoc/api/user.api

63 lines
1.3 KiB
Plaintext

import "base.api"
type (
LoginReq {
id string `json:"id"`
code string `json:"code"`
verify string `json:"verify"`
}
RegReq {
username string `json:"username"`
pwd string `json:"pwd"`
}
getReq {
Id int64 `path:"id"`
}
listReq {
Username string `query:"username"`
}
userResp {
Id string `json:"id"`
Created uint `json:"created"`
Updated uint `json:"updated"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Icon string `json:"icon"`
Status int64 `json:"status"` // 状态0ok1disabled
Used int64 `json:"used"`
Space int64 `json:"space"`
}
)
@server (
group: user
prefix: /api/user
)
service main {
@handler Login
head / (LoginReq) returns ()
@handler Reg
post / (RegReq) returns ()
}
@server (
group: user
middleware: Auth
prefix: /api/user
)
service main {
@handler get
get /:id (getReq) returns (userResp)
@handler list
get / (listReq) returns ([]userResp)
}