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

60 lines
1.1 KiB
Plaintext

import "base.api"
type (
3 months ago
LoginReq {
id string `path:"id"`
4 weeks ago
pwd string `form:"pwd"`
client string `form:"client"`
typ string `form:"typ,optional"`
3 months ago
}
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 (
3 months ago
group: user
prefix: /api/user
)
service main {
3 months ago
@handler Login
head /:id (LoginReq)
3 months ago
@handler Reg
post / (RegReq)
}
@server (
3 months ago
group: user
middleware: Auth
prefix: /api/user
)
service main {
3 months ago
@handler get
get /:id (getReq) returns (userResp)
3 months ago
@handler list
get / (listReq) returns ([]userResp)
}
3 months ago