index.go 521 B

1234567891011121314151617181920212223
  1. package route
  2. import (
  3. "ordonnance/apis/third"
  4. "ordonnance/common/corn"
  5. "ordonnance/common/middleware"
  6. "ordonnance/logger"
  7. "github.com/gin-gonic/gin"
  8. _ "github.com/go-sql-driver/mysql"
  9. )
  10. func RunService(myport string) {
  11. corn.RunCorn()
  12. r := gin.Default()
  13. r.Use(middleware.Recover)
  14. // base
  15. r.GET("/ordonnance/qrcode/:ordonnanceId", third.GetordonnanceQrcode)
  16. r.POST("/ordonnance/detail/:ordonnanceId", third.GetordonnanceDetail)
  17. //
  18. logger.Infof("strat http server @port=%s", myport)
  19. r.Run(":" + myport)
  20. }