package knowledge_approve import ( "encoding/json" "eta_gn/eta_api/models/knowledge_approve" "eta_gn/eta_api/models/knowledge_approve/response" "fmt" ) // FormatKnowledgeResourceApproveNode2Item 格式化报告审批节点信息 func FormatKnowledgeResourceApproveNode2Item(origin *knowledge_approve.KnowledgeResourceApproveNode) (item *response.KnowledgeResourceApproveNodeItem, err error) { if origin == nil { return } item = new(response.KnowledgeResourceApproveNodeItem) item.KnowledgeResourceApproveNodeId = origin.KnowledgeResourceApproveNodeId item.KnowledgeResourceApproveFlowId = origin.KnowledgeResourceApproveFlowId item.PrevNodeId = origin.PrevNodeId item.NextNodeId = origin.NextNodeId item.NodeType = origin.NodeType item.ApproveType = origin.ApproveType item.Users = make([]*response.KnowledgeResourceApproveNodeUser, 0) if origin.Users != "" { e := json.Unmarshal([]byte(origin.Users), &item.Users) if e != nil { err = fmt.Errorf("node users unmarshal err: %s", e.Error()) return } } return }