From 76e633f4b19901975466886efaac7584086704ea Mon Sep 17 00:00:00 2001 From: Hsy <32729842@qq.com> Date: Wed, 18 Dec 2024 14:47:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b88753d..abcdcf0 100644 --- a/README.md +++ b/README.md @@ -92,10 +92,9 @@ GOPROXY=https://goproxy.cn/,direct go install github.com/devttl/goctl-swagger@la 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 . +* 使用 -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/)