创建一个controller文件并在路由中注册
package controllers
import (
"github.com/astaxie/beego"
"fmt"
"strings"
)
type Demo3Controller struct {
beego.Controller
}
func (this *Demo3Controller)Getstring(){
username := this.GetString("username")
nickname := this.GetString("nickname")
password := this.GetString("password")
this.Ctx.WriteString(username+nickname+password)
}
beego.Router("/getstring",&controllers.Demo3Controller{},"Get:Getstring")
然后重启就可以获取到string了

博客介绍了获取string的操作步骤,先创建一个controller文件并在路由中注册,之后重启即可获取到string。
886

被折叠的 条评论
为什么被折叠?



