package main import ( "fmt" "yuleduiPay/controller" "yuleduiPay/middle" "yuleduiPay/service" "github.com/gogf/gf/v2/frame/g" _ "github.com/gogf/gf/contrib/drivers/pgsql/v2" ) func main() { s := g.Server() s.Use(middle.MiddlewareCORS, middle.LoggingMiddleware, middle.MiddlewareHandlerResponse) payRouter := controller.Pay{} s.Group("/api", payRouter.RouterGroup) yesPayRouter := controller.YsePay{} s.Group("/ysePay", yesPayRouter.RouterGroup) err := service.MQTTService.InitMQTT() if err != nil { fmt.Println(err) return } g.Log().Line().Print(nil, "初始化成功") s.Run() }