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)
}

View File

@ -36,6 +36,7 @@
}
}
],
"requestBody": {},
"tags": [
"user-api"
]
@ -54,6 +55,7 @@
"parameters": [
{
"name": "body",
"description": "注册请求结构",
"in": "body",
"required": true,
"schema": {
@ -61,6 +63,7 @@
}
}
],
"requestBody": {},
"tags": [
"user-api"
]
@ -87,6 +90,7 @@
"type": "string"
}
],
"requestBody": {},
"tags": [
"user-api"
]
@ -112,6 +116,7 @@
"type": "string"
}
],
"requestBody": {},
"tags": [
"user-api"
]
@ -222,5 +227,10 @@
"name": "Authorization",
"in": "header"
}
}
},
"security": [
{
"apiKey": []
}
]
}