yuleduiPay/main.go

29 lines
554 B
Go

package main
import (
"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.MiddlewareHandlerResponse)
payRouter := controller.Pay{}
s.Group("/api", payRouter.RouterGroup)
yesPayRouter := controller.YsePay{}
s.Group("/ysePay", yesPayRouter.RouterGroup)
err := service.MQTTService.InitMQTT()
if err != nil {
return
}
g.Log().Line().Print(nil, "初始化成功")
s.Run()
}