(tab *model.DataTable, tableObjectType string, typeTab *model.TypeTable)
| 72 | } |
| 73 | |
| 74 | func resolveHeaderFields(tab *model.DataTable, tableObjectType string, typeTab *model.TypeTable) { |
| 75 | |
| 76 | tab.OriginalHeaderType = tableObjectType |
| 77 | for index, header := range tab.Headers { |
| 78 | |
| 79 | if header.Cell.Value == "" { |
| 80 | continue |
| 81 | } |
| 82 | |
| 83 | tf := typeTab.FieldByName(tableObjectType, header.Cell.Value) |
| 84 | if tf == nil { |
| 85 | report.ReportError("HeaderFieldNotDefined", header.Cell.String(), tableObjectType) |
| 86 | } |
| 87 | |
| 88 | if headerValueExists(index+1, header.Cell.Value, tab.Headers) && !tf.IsArray() { |
| 89 | report.ReportError("DuplicateHeaderField", header.Cell.String()) |
| 90 | } |
| 91 | |
| 92 | // 解析好的类型 |
| 93 | header.TypeInfo = tf |
| 94 | } |
| 95 | |
| 96 | } |
no test coverage detected