GoLang-Beego使用
1.beego 注意事项
beego的默认架构是mvc python的django默认是mtv
package mainimport ("github.com/astaxie/beego"
)type MainController struct {beego.Controller
}func (this *MainController) Get(){this.Ctx.WriteString("hello mybeego")
}func(this *MainController) Post(){user := this.GetString("username") //只能回去urlencode 为a=1&b=2格式//pwd := this.GetString("password")if user == ""{this.Ctx.WriteString("username not get,please check it")}else{this.Ctx.WriteString("111")}}func main(){beego.Router("/",&MainController{})beego.Run("127.0.0.1:9999")
}
转载于:https://www.cnblogs.com/liujiliang/p/10027229.html
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
