更新README.md文件
This commit is contained in:
parent
daf9775177
commit
4fc5fc0bde
14
README.md
14
README.md
@ -86,6 +86,18 @@ GOPROXY=https://goproxy.cn/,direct go install github.com/devttl/goctl-swagger@la
|
||||
goctl api plugin -plugin goctl-swagger="swagger -filename user.json" -api user.api -dir .
|
||||
```
|
||||
|
||||
* -pack 开启外层响应包装并指定外层响应结构名称
|
||||
|
||||
```bash
|
||||
goctl api plugin -plugin goctl-swagger='swagger -filename user.json -pack Response' -api user.api -dir .
|
||||
```
|
||||
|
||||
- 使用 -response指定相应结构
|
||||
|
||||
```bash
|
||||
goctl api plugin -plugin goctl-swagger='swagger -filename user.json -pack Response -response "[{\"name\":\"trace_id\",\"type\":\"string\",\"description\":\"链路追踪id\"},{\"name\":\"code\",\"type\":\"integer\",\"description\":\"状态码\"},{\"name\":\"msg\",\"type\":\"string\",\"description\":\"消息\"},{\"name\":\"data\",\"type\":\"object\",\"description\":\"数据\",\"is_data\":true}]";' -api user.api -dir .
|
||||
```
|
||||
|
||||
* 指定Host,basePath,schemes [api-host-and-base-path](https://swagger.io/docs/specification/2-0/api-host-and-base-path/)
|
||||
|
||||
```shell script
|
||||
@ -107,4 +119,4 @@ GOPROXY=https://goproxy.cn/,direct go install github.com/devttl/goctl-swagger@la
|
||||
-l "$l" \
|
||||
-o "/go-work/clients/$l"
|
||||
done
|
||||
```
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user