正在显示
3 个修改的文件
包含
22 行增加
和
0 行删除
@@ -55,6 +55,7 @@ func init() { | @@ -55,6 +55,7 @@ func init() { | ||
55 | 55 | ||
56 | web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors()) | 56 | web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors()) |
57 | web.InsertFilter("/data/*", web.BeforeRouter, middleware.JwtFilter()) | 57 | web.InsertFilter("/data/*", web.BeforeRouter, middleware.JwtFilter()) |
58 | + web.InsertFilter("/api/tables/*", web.BeforeRouter, middleware.JwtFilter()) | ||
58 | web.InsertFilter("/*", web.BeforeRouter, RequestCostBefore()) | 59 | web.InsertFilter("/*", web.BeforeRouter, RequestCostBefore()) |
59 | web.InsertFilter("/*", web.BeforeExec, controllers.BlacklistFilter(controllers.BlacklistRouters)) | 60 | web.InsertFilter("/*", web.BeforeExec, controllers.BlacklistFilter(controllers.BlacklistRouters)) |
60 | web.InsertFilter("/*", web.BeforeExec, CreateRequestLogFilter(true)) // filters.CreateRequstLogFilter(Logger) | 61 | web.InsertFilter("/*", web.BeforeExec, CreateRequestLogFilter(true)) // filters.CreateRequstLogFilter(Logger) |
@@ -146,6 +146,7 @@ func (controller *TableController) SearchQuerySetTables() { | @@ -146,6 +146,7 @@ func (controller *TableController) SearchQuerySetTables() { | ||
146 | domain.SubProcessTable.ToString(), domain.CalculateTable.ToString()} | 146 | domain.SubProcessTable.ToString(), domain.CalculateTable.ToString()} |
147 | } | 147 | } |
148 | cmd.Module = domain.ModuleQuerySetCenter | 148 | cmd.Module = domain.ModuleQuerySetCenter |
149 | + //cmd.CurrentModule = domain.ModuleQuerySetCenter | ||
149 | cmd.ReturnDetailStructInfo = true | 150 | cmd.ReturnDetailStructInfo = true |
150 | cmd.Context = ParseContext(controller.BaseController) | 151 | cmd.Context = ParseContext(controller.BaseController) |
151 | data, err := tableService.Search(cmd) | 152 | data, err := tableService.Search(cmd) |
@@ -160,6 +161,20 @@ func (controller *TableController) TableObjectSearch() { | @@ -160,6 +161,20 @@ func (controller *TableController) TableObjectSearch() { | ||
160 | if cmd.ReturnGroupItem == nil { | 161 | if cmd.ReturnGroupItem == nil { |
161 | cmd.ReturnGroupItem = &defaultReturnGroup | 162 | cmd.ReturnGroupItem = &defaultReturnGroup |
162 | } | 163 | } |
164 | + cmd.CurrentModule = cmd.Module | ||
165 | + cmd.Context = ParseContext(controller.BaseController) | ||
166 | + data, err := tableService.TableObjectSearch(cmd) | ||
167 | + controller.Response(data, err) | ||
168 | +} | ||
169 | + | ||
170 | +func (controller *TableController) ApiTableObjectSearch() { | ||
171 | + tableService := service.NewTableService(nil) | ||
172 | + cmd := &query.SearchTableQuery{} | ||
173 | + Must(controller.Unmarshal(cmd)) | ||
174 | + defaultReturnGroup := true | ||
175 | + if cmd.ReturnGroupItem == nil { | ||
176 | + cmd.ReturnGroupItem = &defaultReturnGroup | ||
177 | + } | ||
163 | cmd.Context = ParseContext(controller.BaseController) | 178 | cmd.Context = ParseContext(controller.BaseController) |
164 | data, err := tableService.TableObjectSearch(cmd) | 179 | data, err := tableService.TableObjectSearch(cmd) |
165 | controller.Response(data, err) | 180 | controller.Response(data, err) |
@@ -45,4 +45,10 @@ func init() { | @@ -45,4 +45,10 @@ func init() { | ||
45 | web.Router("/data/reset-header-row", tableController, "Post:TableResetHeaderRow") | 45 | web.Router("/data/reset-header-row", tableController, "Post:TableResetHeaderRow") |
46 | 46 | ||
47 | web.Router("/data/tables/exec/:name", tableController, "Get:ExecScript") | 47 | web.Router("/data/tables/exec/:name", tableController, "Get:ExecScript") |
48 | + | ||
49 | + // 外部接口 | ||
50 | + web.Router("/api/tables/field-optional-values", tableController, "Post:FieldOptionalValues") | ||
51 | + web.Router("/api/tables/table-object-search", tableController, "Post:ApiTableObjectSearch") | ||
52 | + web.Router("/api/tables/table-preview", tableController, "Post:Preview") | ||
53 | + web.Router("/api/tables/:tableId", tableController, "Get:GetTable") | ||
48 | } | 54 | } |
-
请 注册 或 登录 后发表评论