コード例 #1
0
ファイル: kmgPage.go プロジェクト: keysonZZZ/kmg
func CreateFromSelectCommandAndHttpContext(Select *MysqlAst.SelectCommand, Ctx *kmgHttp.Context) *KmgPage {
	page := &KmgPage{}
	page.BaseUrl = Ctx.GetRequestUrl()
	page.CurrentPage = Ctx.InNum("Page")
	page.PageKeyName = "Page"
	page.init()
	return page.runSelectCommand(Select)
}
コード例 #2
0
ファイル: runner.go プロジェクト: keysonZZZ/kmg
func Dispatcher(ctx *kmgHttp.Context, processorList []HttpProcessor) {
	apiName := ctx.InStr("n")
	if apiName == "" && EnterPointApiName != "" {
		if ctx.GetRequestUrl() == "/favicon.ico" {
			// 避免网站图标请求,占用大量资源.
			ctx.NotFound("api not found")
			return
		}
		apiName = EnterPointApiName
	}
	apiFunc, ok := controllerObjMap[apiName]
	if !ok {
		ctx.NotFound("api not found")
		return
	}

	apiFunc(ctx)
	return
}