zoukankan      html  css  js  c++  java
  • GoLang-Beego使用

    1.beego 注意事项

      beego的默认架构是mvc python的django默认是mtv

    package main
    
    import (
    	"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")
    }
    

      

  • 相关阅读:
    继承
    对象与类
    反射
    I/O流
    字符串
    Map的entrySet()方法
    接口与内部类
    Git Usage Summary
    HTML(5)
    毕业设计:下载
  • 原文地址:https://www.cnblogs.com/liujiliang/p/10027229.html
Copyright © 2011-2022 走看看