From 7b82eda993918fe4a952b10c5fc7597992c5cabc Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sat, 14 May 2022 17:01:37 +0800 Subject: [PATCH] chore: use get for quickstart, plain logs for easy understanding (#1905) --- tools/goctl/quickstart/idl/api.yaml | 4 +++- tools/goctl/quickstart/idl/greet.api | 2 +- tools/goctl/quickstart/idl/rpc.yaml | 4 ++++ tools/goctl/quickstart/micro.go | 9 +++------ tools/goctl/quickstart/mono.go | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 tools/goctl/quickstart/idl/rpc.yaml diff --git a/tools/goctl/quickstart/idl/api.yaml b/tools/goctl/quickstart/idl/api.yaml index b5ce1830..76ce3d2f 100644 --- a/tools/goctl/quickstart/idl/api.yaml +++ b/tools/goctl/quickstart/idl/api.yaml @@ -1,3 +1,5 @@ Name: ping Host: 127.0.0.1 -Port: 8888 \ No newline at end of file +Port: 8888 +Log: + Encoding: plain \ No newline at end of file diff --git a/tools/goctl/quickstart/idl/greet.api b/tools/goctl/quickstart/idl/greet.api index a3091236..ffaf9b00 100644 --- a/tools/goctl/quickstart/idl/greet.api +++ b/tools/goctl/quickstart/idl/greet.api @@ -6,5 +6,5 @@ type resp { service greet { @handler ping - post /ping returns (resp) + get /ping returns (resp) } diff --git a/tools/goctl/quickstart/idl/rpc.yaml b/tools/goctl/quickstart/idl/rpc.yaml new file mode 100644 index 00000000..b64a0582 --- /dev/null +++ b/tools/goctl/quickstart/idl/rpc.yaml @@ -0,0 +1,4 @@ +Name: greet.rpc +ListenOn: 127.0.0.1:8080 +Log: + Encoding: plain diff --git a/tools/goctl/quickstart/micro.go b/tools/goctl/quickstart/micro.go index 1b8d0203..68e995dd 100644 --- a/tools/goctl/quickstart/micro.go +++ b/tools/goctl/quickstart/micro.go @@ -10,16 +10,13 @@ import ( "github.com/zeromicro/go-zero/tools/goctl/util/pathx" ) -const ( - rpcEtcContent = `Name: greet.rpc -ListenOn: 127.0.0.1:8080 -` - protoName = "greet.proto" -) +const protoName = "greet.proto" var ( //go:embed idl/greet.proto protocContent string + //go:embed idl/rpc.yaml + rpcEtcContent string zRPCWorkDir string ) diff --git a/tools/goctl/quickstart/mono.go b/tools/goctl/quickstart/mono.go index 7f91c655..9331a390 100644 --- a/tools/goctl/quickstart/mono.go +++ b/tools/goctl/quickstart/mono.go @@ -74,6 +74,6 @@ func (m mono) start() { goModTidy(projectDir) } log.Debug(">> Ready to start an API server...") - log.Debug(">> Run 'curl -X POST http://127.0.0.1:8888/ping' after service startup...") + log.Debug(">> Run 'curl http://127.0.0.1:8888/ping' after service startup...") goStart(apiWorkDir) }