作者 yangfu

表对象搜索修改

... ... @@ -55,6 +55,7 @@ func init() {
web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors())
web.InsertFilter("/data/*", web.BeforeRouter, middleware.JwtFilter())
web.InsertFilter("/api/tables/*", web.BeforeRouter, middleware.JwtFilter())
web.InsertFilter("/*", web.BeforeRouter, RequestCostBefore())
web.InsertFilter("/*", web.BeforeExec, controllers.BlacklistFilter(controllers.BlacklistRouters))
web.InsertFilter("/*", web.BeforeExec, CreateRequestLogFilter(true)) // filters.CreateRequstLogFilter(Logger)
... ...
... ... @@ -146,6 +146,7 @@ func (controller *TableController) SearchQuerySetTables() {
domain.SubProcessTable.ToString(), domain.CalculateTable.ToString()}
}
cmd.Module = domain.ModuleQuerySetCenter
//cmd.CurrentModule = domain.ModuleQuerySetCenter
cmd.ReturnDetailStructInfo = true
cmd.Context = ParseContext(controller.BaseController)
data, err := tableService.Search(cmd)
... ... @@ -160,6 +161,20 @@ func (controller *TableController) TableObjectSearch() {
if cmd.ReturnGroupItem == nil {
cmd.ReturnGroupItem = &defaultReturnGroup
}
cmd.CurrentModule = cmd.Module
cmd.Context = ParseContext(controller.BaseController)
data, err := tableService.TableObjectSearch(cmd)
controller.Response(data, err)
}
func (controller *TableController) ApiTableObjectSearch() {
tableService := service.NewTableService(nil)
cmd := &query.SearchTableQuery{}
Must(controller.Unmarshal(cmd))
defaultReturnGroup := true
if cmd.ReturnGroupItem == nil {
cmd.ReturnGroupItem = &defaultReturnGroup
}
cmd.Context = ParseContext(controller.BaseController)
data, err := tableService.TableObjectSearch(cmd)
controller.Response(data, err)
... ...
... ... @@ -45,4 +45,10 @@ func init() {
web.Router("/data/reset-header-row", tableController, "Post:TableResetHeaderRow")
web.Router("/data/tables/exec/:name", tableController, "Get:ExecScript")
// 外部接口
web.Router("/api/tables/field-optional-values", tableController, "Post:FieldOptionalValues")
web.Router("/api/tables/table-object-search", tableController, "Post:ApiTableObjectSearch")
web.Router("/api/tables/table-preview", tableController, "Post:Preview")
web.Router("/api/tables/:tableId", tableController, "Get:GetTable")
}
... ...