2024-04-07 10:12:24 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
2024-04-08 10:13:01 +00:00
|
|
|
"github.com/iapologizewhenimwrong/Vestmore_GO/model"
|
2024-04-07 10:12:24 +00:00
|
|
|
"github.com/iapologizewhenimwrong/Vestmore_GO/server/app/internal/handlers"
|
2024-04-08 10:13:01 +00:00
|
|
|
|
|
|
|
_ "github.com/go-sql-driver/mysql"
|
2024-04-07 10:12:24 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func AppV10(ctx *gin.Context) {
|
2024-04-08 10:13:01 +00:00
|
|
|
|
2024-04-07 10:12:24 +00:00
|
|
|
if actionKey, ok := ctx.GetPostForm("action"); ok {
|
2024-04-08 10:13:01 +00:00
|
|
|
// if token, ok := ctx.GetPostForm("token"); ok {
|
|
|
|
|
|
|
|
// }
|
2024-04-07 10:12:24 +00:00
|
|
|
handlers.HandlersFuncRoutes[actionKey](ctx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2024-04-08 10:13:01 +00:00
|
|
|
|
|
|
|
model.Models.SetSqlxDriver("mysql", "php:aFk3i4Dj#76!4sd@tcp(47.243.100.6:3306)/zunxinfinance?charset=utf8mb4&timeout=10s")
|
|
|
|
|
2024-04-07 10:12:24 +00:00
|
|
|
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")
|
|
|
|
}
|