diff --git a/Knowledge_Test_Go/hack/config.yaml b/Knowledge_Test_Go/hack/config.yaml index 83c7dc6..df94e53 100644 --- a/Knowledge_Test_Go/hack/config.yaml +++ b/Knowledge_Test_Go/hack/config.yaml @@ -1,13 +1,20 @@ +# https://goframe.org/docs/web/server-config-file-template +server: + address: ":8000" + openapiPath: "/api.json" + swaggerPath: "/swagger" + +# https://goframe.org/docs/core/glog-config +logger: + level : "all" + stdout: true + +# https://goframe.org/docs/core/gdb-config-file + + +database: + default: + debug: true + link: "mysql:root:123456@tcp(127.0.0.1:3306)/练习1?loc=Local&parseTime=true" + -# CLI tool, only in development environment. -# https://goframe.org/docs/cli -gfcli: - gen: - dao: - - link: "mysql:root:12345678@tcp(127.0.0.1:3306)/test" - descriptionTag: true - - docker: - build: "-a amd64 -s linux -p temp -ew" - tagPrefixes: - - my.image.pub/my-app \ No newline at end of file diff --git a/Knowledge_Test_Go/internal/cmd/cmd.go b/Knowledge_Test_Go/internal/cmd/cmd.go index 68a3c54..4bc2366 100644 --- a/Knowledge_Test_Go/internal/cmd/cmd.go +++ b/Knowledge_Test_Go/internal/cmd/cmd.go @@ -17,7 +17,13 @@ var ( Brief: "start http server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { s := g.Server() - s.Group("/", func(group *ghttp.RouterGroup) { + s.Group("/api", func(group *ghttp.RouterGroup) { + group.Middleware(ghttp.MiddlewareHandlerResponse) + group.Bind( + hello.NewV1(), + ) + }) + s.Group("/admin", func(group *ghttp.RouterGroup) { group.Middleware(ghttp.MiddlewareHandlerResponse) group.Bind( hello.NewV1(),