From 5705c1c9ac9fce863306cfbcb1661acd0832e62f Mon Sep 17 00:00:00 2001 From: majun <3060162534@qq.com> Date: Fri, 29 Nov 2024 11:49:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/hello/hello.go | 15 --------------- api/hello/v1/hello.go | 12 ------------ hack/config.yaml | 2 +- internal/cmd/cmd.go | 4 ++-- internal/controller/hello/hello.go | 5 ----- internal/controller/hello/hello_new.go | 16 ---------------- internal/controller/hello/hello_v1_hello.go | 13 ------------- 7 files changed, 3 insertions(+), 64 deletions(-) delete mode 100644 api/hello/hello.go delete mode 100644 api/hello/v1/hello.go delete mode 100644 internal/controller/hello/hello.go delete mode 100644 internal/controller/hello/hello_new.go delete mode 100644 internal/controller/hello/hello_v1_hello.go diff --git a/api/hello/hello.go b/api/hello/hello.go deleted file mode 100644 index 22743a0..0000000 --- a/api/hello/hello.go +++ /dev/null @@ -1,15 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package hello - -import ( - "context" - - "practice_Go/api/hello/v1" -) - -type IHelloV1 interface { - Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) -} diff --git a/api/hello/v1/hello.go b/api/hello/v1/hello.go deleted file mode 100644 index b4dd233..0000000 --- a/api/hello/v1/hello.go +++ /dev/null @@ -1,12 +0,0 @@ -package v1 - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -type HelloReq struct { - g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"` -} -type HelloRes struct { - g.Meta `mime:"text/html" example:"string"` -} diff --git a/hack/config.yaml b/hack/config.yaml index 83c7dc6..5ee0348 100644 --- a/hack/config.yaml +++ b/hack/config.yaml @@ -4,7 +4,7 @@ gfcli: gen: dao: - - link: "mysql:root:12345678@tcp(127.0.0.1:3306)/test" + - link: "mysql:root:123456@tcp(127.0.0.1:3306)/demo" descriptionTag: true docker: diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 07c821e..530895b 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -7,7 +7,7 @@ import ( "github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/os/gcmd" - "practice_Go/internal/controller/hello" + ) var ( @@ -20,7 +20,7 @@ var ( s.Group("/", func(group *ghttp.RouterGroup) { group.Middleware(ghttp.MiddlewareHandlerResponse) group.Bind( - hello.NewV1(), + ) }) s.Run() diff --git a/internal/controller/hello/hello.go b/internal/controller/hello/hello.go deleted file mode 100644 index f72082f..0000000 --- a/internal/controller/hello/hello.go +++ /dev/null @@ -1,5 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package hello diff --git a/internal/controller/hello/hello_new.go b/internal/controller/hello/hello_new.go deleted file mode 100644 index 29a0c36..0000000 --- a/internal/controller/hello/hello_new.go +++ /dev/null @@ -1,16 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package hello - -import ( - "practice_Go/api/hello" -) - -type ControllerV1 struct{} - -func NewV1() hello.IHelloV1 { - return &ControllerV1{} -} - diff --git a/internal/controller/hello/hello_v1_hello.go b/internal/controller/hello/hello_v1_hello.go deleted file mode 100644 index 04e0195..0000000 --- a/internal/controller/hello/hello_v1_hello.go +++ /dev/null @@ -1,13 +0,0 @@ -package hello - -import ( - "context" - "github.com/gogf/gf/v2/frame/g" - - "practice_Go/api/hello/v1" -) - -func (c *ControllerV1) Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) { - g.RequestFromCtx(ctx).Response.Writeln("Hello World!") - return -}