This commit is contained in:
eson 2024-04-08 23:50:49 +08:00
parent 864a4a8b4c
commit 8b7b138ca2
2 changed files with 11 additions and 5 deletions

View File

@ -3,6 +3,6 @@ package account
import "github.com/gin-gonic/gin" import "github.com/gin-gonic/gin"
// 注册使用email // 注册使用email
func PostRegisterWithEmail(ctx *gin.Context) { func RegisterWithEmail(ctx *gin.Context) {
} }

View File

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