示例#1
0
文件: demo.go 项目: panjiang/goweb
func Demo(c *context.Context) {
	s := c.FormValue("s")
	switch s {
	case "ResponseText":
		reText(c)
	case "ResponseJsonSuccess":
		reJsonSuccess(c)
	case "ResponseJsonError":
		reJsonError(c)
	default:
		index(c)
	}
}
示例#2
0
文件: index.go 项目: panjiang/goweb
func Index(c *context.Context) {
	c.Html("index", nil)
}
示例#3
0
文件: demo.go 项目: panjiang/goweb
func reJsonError(c *context.Context) {
	c.JsonError(1, "Response Json Error")
}
示例#4
0
文件: demo.go 项目: panjiang/goweb
func reJsonSuccess(c *context.Context) {
	m := Message{"Jiang", "Response Json Success", 2}
	c.JsonSuccess(m)
}
示例#5
0
文件: demo.go 项目: panjiang/goweb
func reText(c *context.Context) {
	c.Text("Response Text")
}
示例#6
0
文件: demo.go 项目: panjiang/goweb
func index(c *context.Context) {
	c.Html("demo", demoUnits)
}