You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
735 B
Go

11 months ago
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"jypay/api"
"jypay/global"
"jypay/initialize"
"jypay/utils"
)
func main() {
global.Config = initialize.InitConfig()
global.DB = initialize.InitDB(global.Config)
fmt.Println(global.Config)
r := gin.Default()
r.GET("/ping", utils.BuildJsonHandler(api.Index))
r.GET("/error", utils.BuildJsonHandler(api.Error))
r.POST("/pay", utils.BuildJsonHandler(api.Pay))
11 months ago
r.GET("/payment", utils.BuildHandler(api.Payment))
11 months ago
r.POST("/notify", utils.BuildHandler(api.Notify))
11 months ago
r.GET("/return", utils.BuildHandler(api.Return))
11 months ago
r.GET("/test-post", utils.BuildJsonHandler(api.TestPost))
11 months ago
err := r.Run(":" + global.Config.Server.Port) // listen and serve on 0.0.0.0:8080
11 months ago
panic(err)
}