You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
794 B

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. package cmd
  2. import (
  3. "context"
  4. "practice_Go/internal/controller/channel"
  5. "practice_Go/internal/controller/subscription"
  6. "practice_Go/internal/controller/live"
  7. "practice_Go/internal/controller/reservation"
  8. "github.com/gogf/gf/v2/frame/g"
  9. "github.com/gogf/gf/v2/net/ghttp"
  10. "github.com/gogf/gf/v2/os/gcmd"
  11. )
  12. var (
  13. Main = gcmd.Command{
  14. Name: "main",
  15. Usage: "main",
  16. Brief: "start http server",
  17. Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
  18. s := g.Server()
  19. s.Group("/", func(group *ghttp.RouterGroup) {
  20. group.Middleware(ghttp.MiddlewareHandlerResponse)
  21. group.Bind(
  22. channel.NewV1(),
  23. subscription.NewV1(),
  24. live.NewV1(),
  25. reservation.NewV1(),
  26. )
  27. })
  28. s.SetServerRoot("resource/public")
  29. s.Run()
  30. return nil
  31. },
  32. }
  33. )