package controllers import ( "github.com/astaxie/beego" ) type MainController struct { beego.Controller } func (c *MainController) Get() { c.Data["Website"] = "kingsome.me" c.Data["Email"] = "pengtao@kingsome.com" c.TplName = "index.tpl" } func (this *MainController) Post() { jsoninfo := this.GetString("jsoninfo") if jsoninfo == "" { this.Ctx.WriteString("jsoninfo is empty") return } } type TestController struct { beego.Controller } func (c *TestController) Get() { c.Data["Website"] = "kingsome.me" c.Data["Email"] = "test@kingsome.com" c.TplName = "index.tpl" }