package Controllers import ( "fmt" "github.com/gin-gonic/gin" Mysql "goLoad1/Databases" "goLoad1/Models/loginMondel" "goLoad1/Services" "net/http" ) type RegisterInfo struct { } func (con RegisterInfo) RegisterController(c *gin.Context) { fmt.Print("执行") // 获取参数 name := c.PostForm("userName") password := c.PostForm("password") status := Services.LoginCheck(name, password, c) if status["nameStatus"] && status["passwordStatus"] { data := loginMondel.Register{ UserName: name, Password: password, } Mysql.DB.Create(&data) c.String(http.StatusOK, "成功") } }