2024-11-05 08:32:10 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"yuleduiPay/controller"
|
|
|
|
"yuleduiPay/middle"
|
2024-11-05 17:34:58 +08:00
|
|
|
"yuleduiPay/service"
|
2024-11-05 08:32:10 +08:00
|
|
|
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
|
|
|
|
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2024-11-05 17:34:58 +08:00
|
|
|
|
2024-11-05 08:32:10 +08:00
|
|
|
s := g.Server()
|
|
|
|
s.Use(middle.MiddlewareCORS, middle.MiddlewareHandlerResponse)
|
|
|
|
payRouter := controller.Pay{}
|
2024-11-08 15:19:11 +08:00
|
|
|
s.Group("/api", payRouter.RouterGroup)
|
2024-11-05 17:34:58 +08:00
|
|
|
yesPayRouter := controller.YsePay{}
|
|
|
|
s.Group("/ysePay", yesPayRouter.RouterGroup)
|
2024-11-06 15:15:45 +08:00
|
|
|
err := service.MQTTService.InitMQTT()
|
2024-11-05 17:34:58 +08:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
2024-11-05 09:49:02 +08:00
|
|
|
g.Log().Line().Print(nil, "初始化成功")
|
2024-11-05 08:32:10 +08:00
|
|
|
s.Run()
|
|
|
|
|
|
|
|
}
|