예제 #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)
}