You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
490 B
Go

9 months ago
package controllers
import (
"fmt"
"weather/models"
"github.com/astaxie/beego"
_ "github.com/astaxie/beego/session/mysql"
)
type CMSController struct {
beego.Controller
}
func (c *CMSController) Get() {
c.TplName = "form.tpl"
}
func (c *CMSController) Post() {
u := models.User{}
if err := c.ParseForm(&u); err != nil {
c.Ctx.WriteString("jsoninfo is empty")
return
}
fmt.Println(u.Name)
fmt.Println(u.Age)
fmt.Println(u.Email)
c.Ctx.Output.Body([]byte("heleo"))
}