指定外层响应结构

This commit is contained in:
Hsy
2024-12-18 12:08:19 +08:00
parent 80a696bc8c
commit 517ff9a42e
8 changed files with 182 additions and 2933 deletions

11
main.go
View File

@@ -5,8 +5,9 @@ import (
"os"
"runtime"
"github.com/devttl/goctl-swagger/action"
"github.com/devttl/goctl-swagger/generate"
"github.com/urfave/cli/v2"
"github.com/zeromicro/goctl-swagger/action"
)
var (
@@ -33,6 +34,14 @@ var (
Name: "schemes",
Usage: "swagger support schemes: http, https, ws, wss",
},
&cli.StringFlag{
Name: "pack", // 开启外层响应包装并指定外层响应结构名称
Usage: "use outer packaging response and specify the name, example: Response",
},
&cli.StringFlag{
Name: "response", // 指定外层响应结构
Usage: "outer packaging response structure, example: " + fmt.Sprintf("%q", generate.DefaultResponseJson),
},
},
},
}