44 lines
957 B
Go
44 lines
957 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/iapologizewhenimwrong/Vestmore_GO/server/app/internal/handlers/account"
|
|
|
|
_ "github.com/go-sql-driver/mysql"
|
|
)
|
|
|
|
func AppV1_0(ctx *gin.Context) {
|
|
|
|
if actionKey, ok := ctx.GetPostForm("action"); ok {
|
|
// if token, ok := ctx.GetPostForm("token"); ok {
|
|
|
|
// }
|
|
handlers.HandlersFuncRoutes[actionKey](ctx)
|
|
return
|
|
}
|
|
|
|
}
|
|
|
|
func main() {
|
|
|
|
model.Models.SetSqlxDriver("mysql", "php:aFk3i4Dj#76!4sd@tcp(47.243.100.6:3306)/zunxinfinance?charset=utf8mb4&timeout=10s")
|
|
|
|
r := gin.Default()
|
|
|
|
app_1_0 := r.Group("app")
|
|
|
|
account_1_0 := app_1_0.Group("account")
|
|
account_1_0.POST("/register_with_email", account.RegisterWithEmail)
|
|
|
|
app_1_0.POST("/1_0", AppV1_0)
|
|
for k := range handlers.HandlersFuncRoutes {
|
|
log.Printf("api action %s", k)
|
|
}
|
|
|
|
r.Run(":8080")
|
|
}
|