duyong vor 3 Monaten
Ursprung
Commit
d385a7ef51
1 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
  1. 6 6
      approve_former/parse.go

+ 6 - 6
approve_former/parse.go

@@ -43,7 +43,7 @@ func ParseFlowFromJson(flowName, flowType, frontJson, argObj string) (string, er
 	})
 	root.Children.NodeLevel = 1
 	root.Children.NamePrefix = "1-"
-	err = traverseTree(flow, root.Children, nil)
+	err = traverseTree(flow, root.Children)
 	if err != nil {
 		return "", err
 	}
@@ -56,7 +56,7 @@ func ParseFlowFromJson(flowName, flowType, frontJson, argObj string) (string, er
 	return tmpStr, nil
 }
 
-func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
+func traverseTree(flow *Flow, node *Node) error {
 	if node == nil {
 		return nil
 	}
@@ -65,7 +65,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
 	// 生成模板逻辑
 	switch node.Type {
 	case NodeTypeApproval:
-		err := buildApprovalFlow(flow, node, parentNode)
+		err := buildApprovalFlow(flow, node)
 		if err != nil {
 			return err
 		}
@@ -77,7 +77,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
 	for index, branch := range node.Branchs {
 		branch.Children.NodeLevel = node.NodeLevel + 1
 		branch.Children.NamePrefix = fmt.Sprintf("%d-%d-", branch.Children.NodeLevel, index)
-		err := traverseTree(flow, branch.Children, node)
+		err := traverseTree(flow, branch.Children)
 		if err != nil {
 			return err
 		}
@@ -87,7 +87,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
 	if node.Children != nil {
 		node.Children.NodeLevel = node.NodeLevel + 1
 		node.Children.NamePrefix = fmt.Sprintf("%d-", node.Children.NodeLevel)
-		err := traverseTree(flow, node.Children, node)
+		err := traverseTree(flow, node.Children)
 		if err != nil {
 			return err
 		}
@@ -96,7 +96,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
 	return nil
 }
 
-func buildApprovalFlow(flow *Flow, node *Node, parentNode *Node) error {
+func buildApprovalFlow(flow *Flow, node *Node) error {
 	if node == nil {
 		return nil
 	}