index.go 767 B

123456789101112131415161718192021222324252627282930
  1. package route
  2. import (
  3. "ordonnance/apis/game"
  4. "ordonnance/apis/third"
  5. "ordonnance/common/corn"
  6. "ordonnance/common/middleware"
  7. "ordonnance/logger"
  8. "github.com/gin-gonic/gin"
  9. _ "github.com/go-sql-driver/mysql"
  10. )
  11. func RunService(myport string) {
  12. corn.RunCorn()
  13. r := gin.Default()
  14. r.Use(middleware.Recover)
  15. // base
  16. r.GET("/ordonnance/qrcode/:ordonnanceId", third.GetordonnanceQrcode)
  17. r.POST("/ordonnance/detail/:ordonnanceId", third.GetordonnanceDetail)
  18. r.POST("/account/login", game.Login)
  19. r.POST("/account/register", game.Register)
  20. r.POST("/account/serverList", game.ServerList)
  21. r.POST("/account/getGate", game.GetGate)
  22. r.POST("/qmbz/recordAction", game.RecordAction)
  23. //
  24. logger.Infof("strat http server @port=%s", myport)
  25. r.Run(":" + myport)
  26. }