@ -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)
|
||||
}
|
@ -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": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user