34 lines
660 B
Go
34 lines
660 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"yuleduiPay/controller"
|
|
"yuleduiPay/middle"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
|
|
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
|
|
)
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
ctx := gctx.New()
|
|
portStr, err := g.Cfg().Get(ctx, "server.port")
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
|
|
port := portStr.Int()
|
|
s.Use(middle.MiddlewareCORS, middle.MiddlewareHandlerResponse)
|
|
payRouter := controller.Pay{}
|
|
s.Group("/wxApi", payRouter.RouterGroup)
|
|
//s.SetOpenApiPath("/api.json")
|
|
//s.SetSwaggerPath("/swagger") //swagger路径
|
|
s.SetPort(port)
|
|
g.Log().Line().Print(ctx, "初始化成功")
|
|
s.Run()
|
|
|
|
}
|