Vestmore_GO/server/app/main.go
2024-04-08 18:13:01 +08:00

38 lines
734 B
Go

package main
import (
"log"
"github.com/gin-gonic/gin"
"github.com/iapologizewhenimwrong/Vestmore_GO/model"
"github.com/iapologizewhenimwrong/Vestmore_GO/server/app/internal/handlers"
_ "github.com/go-sql-driver/mysql"
)
func AppV10(ctx *gin.Context) {
if actionKey, ok := ctx.GetPostForm("action"); ok {
// if token, ok := ctx.GetPostForm("token"); ok {
// }
handlers.HandlersFuncRoutes[actionKey](ctx)
}
}
func main() {
model.Models.SetSqlxDriver("mysql", "php:aFk3i4Dj#76!4sd@tcp(47.243.100.6:3306)/zunxinfinance?charset=utf8mb4&timeout=10s")
r := gin.Default()
v10 := r.Group("app")
v10.POST("/1_0", AppV10)
for k := range handlers.HandlersFuncRoutes {
log.Printf("api %s", k)
}
r.Run(":8080")
}