mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-07-24 17:36:56 +08:00
feat(goctl): support custom Swagger response status (#5691)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -82,6 +82,7 @@ type (
|
||||
service Swagger {
|
||||
@doc (
|
||||
description: "form demo"
|
||||
respCode: "201" // HTTP status code corresponding to Swagger
|
||||
)
|
||||
@handler form
|
||||
post /form (FormReq) returns (FormResp)
|
||||
@@ -238,4 +239,3 @@ service Swagger {
|
||||
@handler jsonComplex
|
||||
post /json/complex (ComplexJsonReq) returns (ComplexJsonResp)
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"201": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
|
||||
@@ -84,6 +84,7 @@ type (
|
||||
service Swagger {
|
||||
@doc (
|
||||
description: "form 接口"
|
||||
respCode: "201" // 对应 Swagger 的 HTTP 状态码
|
||||
)
|
||||
@handler form
|
||||
post /form (FormReq) returns (FormResp)
|
||||
@@ -244,4 +245,3 @@ service Swagger {
|
||||
@handler jsonComplex
|
||||
post /json/complex (ComplexJsonReq) returns (ComplexJsonResp)
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"201": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
|
||||
Reference in New Issue
Block a user