初始化项目结构

This commit is contained in:
2025-05-27 11:37:13 +08:00
commit 81594a8972
42 changed files with 441 additions and 0 deletions

30
internal/cmd/cmd.go Normal file
View File

@ -0,0 +1,30 @@
package cmd
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gcmd"
"server/internal/controller/hello"
)
var (
Main = gcmd.Command{
Name: "main",
Usage: "main",
Brief: "start http server",
Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
s := g.Server()
s.Group("/", func(group *ghttp.RouterGroup) {
group.Middleware(ghttp.MiddlewareHandlerResponse)
group.Bind(
hello.NewV1(),
)
})
s.Run()
return nil
},
}
)