mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
29 lines
827 B
Go
29 lines
827 B
Go
package controller
|
|
|
|
import (
|
|
"glc/conf"
|
|
"glc/gweb"
|
|
"glc/ldb"
|
|
|
|
"github.com/gotoeasy/glang/cmn"
|
|
)
|
|
|
|
// 日志检索(表单提交方式)
|
|
func LogSearchController(req *gweb.HttpRequest) *gweb.HttpResult {
|
|
|
|
if conf.IsEnableLogin() && req.GetFormParameter("token") != GetSessionid() {
|
|
return gweb.Error403() // 登录检查
|
|
}
|
|
|
|
storeName := req.GetFormParameter("storeName")
|
|
//searchKey := tokenizer.GetSearchKey(req.GetFormParameter("searchKey"))
|
|
searchKey := req.GetFormParameter("searchKey")
|
|
pageSize := cmn.StringToInt(req.GetFormParameter("pageSize"), 20)
|
|
currentId := cmn.StringToUint32(req.GetFormParameter("currentId"), 0)
|
|
forward := cmn.StringToBool(req.GetFormParameter("forward"), true)
|
|
|
|
eng := ldb.NewEngine(storeName)
|
|
rs := eng.Search(searchKey, pageSize, currentId, forward)
|
|
return gweb.Result(rs)
|
|
}
|