- 博客(5)
- 收藏
- 关注
原创 Beego ———— orm实现获取数据并写入到数据库中
新建一个controller文件,当用户访问http://localhost:8080/registe这个地址时 提交get,get方法返回一个页面让用户填写数据并post提交,post获得数据,并解析,我写了两种方式,一个是,根据关键词,并初始化一个新的结构体,让其插入到数据库中,package controllersimport ( "github.com/astaxie/bee...
2018-08-30 22:16:55 3043
原创 Beego ———— 从浏览器中获取文件
新建一个controller 实现对文件的获取并保存功能package controllersimport ( "github.com/astaxie/beego" "fmt" "strings")type Demo3Controller struct { beego.Controller}func (this *Demo3Controller)Getfile()...
2018-08-30 22:13:59 1747
原创 Beego ———— 从浏览器中获取string数据
创建一个controller文件并在路由中注册package controllersimport ( "github.com/astaxie/beego" "fmt" "strings")type Demo3Controller struct { beego.Controller}func (this *Demo3Controller)Getstring(){ u...
2018-08-30 22:12:03 1488
原创 Beego ———— 输出json和xml类型数据
首先新建一个controllerpackage controllersimport ( "github.com/astaxie/beego")type Demo2Controller struct { beego.Controller}type Person struct { Name string Nickname string password stri...
2018-08-30 22:07:22 1417
原创 Beego ———— cookie
cookie首先新建一个controllerpackage controllersimport "github.com/astaxie/beego"type Demo1Controller struct { beego.Controller}func (this *Demo1Controller)Get(){ //获取cookie没有就set username...
2018-08-30 22:00:56 615
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人