@@ -10,14 +10,13 @@ import (
1010)
1111
1212type Request struct {
13- Debug int8
14- Version string
15- Method string
16- Tag string
17- StructureDb map [string ]any `orm:"structure"`
18- Structure map [string ]* Structure `orm:"-"`
19- Detail string
20- CreatedAt * gtime.Time
13+ Debug int8
14+ Version string
15+ Method string
16+ Tag string
17+ Structure map [string ]* Structure
18+ Detail string
19+ CreatedAt * gtime.Time
2120 // 节点执行顺序
2221 ExecQueue []string
2322 Executor map [string ]string
@@ -51,35 +50,40 @@ func NewRequestConfig(requestList []Request) *RequestConfig {
5150 item := _item
5251 tag , _ := getTag (item .Tag )
5352
54- if strings .ToLower (tag ) != tag {
55- // 本身大写, 如果没有外层, 则套一层
56- if _ , ok := item .StructureDb [tag ]; ! ok {
57- item .StructureDb = map [string ]any {
58- tag : item .StructureDb ,
59- }
60- }
53+ if item .Structure == nil {
54+ item .Structure = make (map [string ]* Structure )
6155 }
6256
63- item .Structure = make (map [string ]* Structure )
64- //for k, v := range item.StructureDb {
65- // structure := Structure{}
66- // err := gconv.Scan(v, &structure)
67- // if err != nil {
68- // panic(err)
69- // }
70- //
71- // if structure.Must != nil {
72- // structure.Must = strings.Split(structure.Must[0], ",")
73- // }
74- // if structure.Refuse != nil {
75- // structure.Refuse = strings.Split(structure.Refuse[0], ",")
57+ // provider处理
58+ //if strings.ToLower(tag) != tag {
59+ // // 本身大写, 如果没有外层, 则套一层
60+ // if _, ok := item.Structure[tag]; !ok {
61+ // item.Structure = map[string]any{
62+ // tag: item.Structure,
63+ // }
7664 // }
77- //
78- // item.Structure[k] = &structure
7965 //}
8066
67+ for k , v := range item .Structure {
68+ structure := Structure {}
69+ err := gconv .Scan (v , & structure )
70+ if err != nil {
71+ panic (err )
72+ }
73+
74+ if structure .Must != nil {
75+ structure .Must = strings .Split (structure .Must [0 ], "," )
76+ }
77+ if structure .Refuse != nil {
78+ structure .Refuse = strings .Split (structure .Refuse [0 ], "," )
79+ }
80+
81+ item .Structure [k ] = & structure
82+ }
83+
8184 if len (item .ExecQueue ) > 0 {
82- item .ExecQueue = strings .Split (item .ExecQueue [0 ], "," )
85+ // todo db provider处理
86+ //item.ExecQueue = strings.Split(item.ExecQueue[0], ",")
8387 } else {
8488 item .ExecQueue = []string {tag }
8589 }
0 commit comments