|
|
@@ -2,8 +2,10 @@ package metamanagement
|
|
2
|
2
|
|
|
3
|
3
|
import (
|
|
4
|
4
|
"context"
|
|
|
5
|
+ "encoding/json"
|
|
5
|
6
|
|
|
6
|
7
|
"git.x2erp.com/qdy/go-base/ctx"
|
|
|
8
|
+ "git.x2erp.com/qdy/go-base/logger"
|
|
7
|
9
|
"git.x2erp.com/qdy/go-base/model/request/tabulatorreq"
|
|
8
|
10
|
"git.x2erp.com/qdy/go-base/model/response"
|
|
9
|
11
|
"git.x2erp.com/qdy/go-db/factory/database"
|
|
|
@@ -11,20 +13,34 @@ import (
|
|
11
|
13
|
)
|
|
12
|
14
|
|
|
13
|
15
|
// TabulatorConfigMetaRequest Tabulator专用的配置元请求
|
|
14
|
|
-type TabulatorConfigMetaRequest struct {
|
|
15
|
|
- tabulatorreq.TabulatorRequest
|
|
16
|
|
-}
|
|
|
16
|
+//type TabulatorConfigMetaRequest struct {
|
|
|
17
|
+// tabulatorreq.TabulatorRequest
|
|
|
18
|
+//}
|
|
17
|
19
|
|
|
18
|
20
|
// ListConfigMetaTabulator Tabulator格式的配置元查询
|
|
19
|
|
-func ListConfigMetaTabulator(req *TabulatorConfigMetaRequest, ctx context.Context, dbFactory *database.DBFactory, reqCtx *ctx.RequestContext) *response.QueryResult[[]tables.ConfigMetaDB] {
|
|
|
21
|
+func ListConfigMetaTabulator(req *tabulatorreq.TabulatorRequest, ctx context.Context, dbFactory *database.DBFactory, reqCtx *ctx.RequestContext) *response.QueryResult[[]tables.ConfigMetaDB] {
|
|
|
22
|
+ // 调试:记录接收到的原始请求
|
|
|
23
|
+ if logger.IsDebug() {
|
|
|
24
|
+ logger.Debug("TabulatorConfigMetaRequest 原始请求: %+v", req)
|
|
|
25
|
+ if req != nil {
|
|
|
26
|
+ jsonBytes, _ := json.Marshal(req)
|
|
|
27
|
+ logger.Debug("TabulatorRequest: %s", jsonBytes)
|
|
|
28
|
+ }
|
|
|
29
|
+ }
|
|
|
30
|
+
|
|
20
|
31
|
// 验证请求参数
|
|
21
|
32
|
if req == nil {
|
|
22
|
|
- req = &TabulatorConfigMetaRequest{}
|
|
|
33
|
+ req = &tabulatorreq.TabulatorRequest{}
|
|
23
|
34
|
req.Page = 1
|
|
24
|
35
|
req.Size = 10
|
|
25
|
36
|
}
|
|
26
|
37
|
req.Validate()
|
|
27
|
38
|
|
|
|
39
|
+ // 调试:验证后的值
|
|
|
40
|
+ if logger.IsDebug() {
|
|
|
41
|
+ logger.Debug("TabulatorConfigMetaRequest 验证后: Page=%d, Size=%d", req.Page, req.Size)
|
|
|
42
|
+ }
|
|
|
43
|
+
|
|
28
|
44
|
// 定义字段映射:前端字段名 -> 后端字段名
|
|
29
|
45
|
fieldMapper := func(field string) string {
|
|
30
|
46
|
switch field {
|