support api prefix (#22) patch method (#21)

This commit is contained in:
MaxToby
2022-02-15 21:22:54 +08:00
parent bd6092ac10
commit 0aac4b39f3
7 changed files with 68 additions and 37 deletions

View File

@ -8,6 +8,8 @@ info(
type (
//注册请求结构
RegisterReq {
Username string `json:"username"`
Password string `json:"password"`
@ -35,28 +37,32 @@ type (
}
)
@server(
prefix: /api
)
service user-api {
@doc(
summary: 注册
)
@handler register
post /api/user/register (RegisterReq)
post /user/register (RegisterReq)
@doc(
summary: 登录
)
@handler login
post /api/user/login (LoginReq)
post /user/login (LoginReq)
@doc(
summary: 获取用户信息
)
@handler getUserInfo
get /api/user/:id (UserInfoReq) returns (UserInfoReply)
get /user/:id (UserInfoReq) returns (UserInfoReply)
@doc(
summary: 用户搜索
)
@handler searchUser
get /api/user/search (UserSearchReq) returns (UserInfoReply)
get /user/search (UserSearchReq) returns (UserInfoReply)
}