From 0efa28ddbdd4d5e1d25b5b4917c0cbebc1bc7b7c Mon Sep 17 00:00:00 2001 From: kingxt Date: Fri, 21 Aug 2020 13:47:35 +0800 Subject: [PATCH] fix generate api demo (#19) Co-authored-by: kingxt --- tools/goctl/api/apigen/gen.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/goctl/api/apigen/gen.go b/tools/goctl/api/apigen/gen.go index 5e8883df..5d50cbf8 100644 --- a/tools/goctl/api/apigen/gen.go +++ b/tools/goctl/api/apigen/gen.go @@ -19,29 +19,24 @@ const apiTemplate = `info( email: {{.gitEmail}} ) -type request struct{ +type request struct { // TODO: add members here and delete this comment } -type response struct{ +type response struct { // TODO: add members here and delete this comment } -@server( - port: // TODO: add port here and delete this comment -) service {{.serviceName}} { @server( handler: // TODO: set handler name and delete this comment ) - // TODO: edit the below line - // get /users/id/:userId(request) returns(response) + get /users/id/:userId(request) returns(response) @server( handler: // TODO: set handler name and delete this comment ) - // TODO: edit the below line - // post /users/create(request) + post /users/create(request) } `