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.

28 lines
612 B

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. package cmd
  2. import (
  3. "MangheGo/internal/controller/prize"
  4. "MangheGo/internal/logic/middleware"
  5. "context"
  6. "github.com/gogf/gf/v2/frame/g"
  7. "github.com/gogf/gf/v2/net/ghttp"
  8. "github.com/gogf/gf/v2/os/gcmd"
  9. )
  10. var (
  11. Main = gcmd.Command{
  12. Name: "main",
  13. Usage: "main",
  14. Brief: "start http server",
  15. Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
  16. s := g.Server()
  17. s.Group("/api/prize_activity", func(group *ghttp.RouterGroup) {
  18. group.Middleware(middleware.MiddlewareCORS)
  19. group.POST("/get-prize-list", prize.Prize().GetPrizeList)
  20. })
  21. s.Run()
  22. return nil
  23. },
  24. }
  25. )