yuleduiPay/main.go

31 lines
606 B
Go
Raw Normal View History

2024-11-05 08:32:10 +08:00
package main
import (
2024-11-18 09:15:45 +08:00
"fmt"
2024-11-05 08:32:10 +08:00
"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()
2024-11-18 09:15:45 +08:00
s.Use(middle.MiddlewareCORS, middle.LoggingMiddleware, middle.MiddlewareHandlerResponse)
2024-11-05 08:32:10 +08:00
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 {
2024-11-18 09:15:45 +08:00
fmt.Println(err)
2024-11-05 17:34:58 +08:00
return
}
2024-11-05 09:49:02 +08:00
g.Log().Line().Print(nil, "初始化成功")
2024-11-05 08:32:10 +08:00
s.Run()
}