support for multiple routing response docs
This commit is contained in:
@ -36,6 +36,11 @@ type (
|
||||
UserSearchReq {
|
||||
KeyWord string `form:"keyWord"` // 关键词
|
||||
}
|
||||
|
||||
ErrorResponse {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
)
|
||||
|
||||
@server(
|
||||
@ -59,6 +64,13 @@ service user-api {
|
||||
summary: 获取用户信息
|
||||
)
|
||||
@handler getUserInfo
|
||||
/*
|
||||
@respdoc-400 (
|
||||
100101: out of authority
|
||||
100102: user not exist
|
||||
) // Error code list
|
||||
*/
|
||||
/* @respdoc-500 (ErrorResponse) // Server Error */
|
||||
get /user/:id (UserInfoReq) returns (UserInfoReply)
|
||||
|
||||
@doc(
|
||||
|
@ -103,6 +103,18 @@
|
||||
"schema": {
|
||||
"$ref": "#/definitions/UserInfoReply"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Error code list",
|
||||
"schema": {
|
||||
"example": "{\"100101\":\"out of authority\",\"100102\":\"user not exist\"}"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
@ -120,6 +132,22 @@
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"ErrorResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "ErrorResponse",
|
||||
"required": [
|
||||
"code",
|
||||
"message"
|
||||
]
|
||||
},
|
||||
"LoginReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
Reference in New Issue
Block a user