...
|
...
|
@@ -206,11 +206,12 @@ func ToFieldSchemaEnNames(fields []*domain.Field) []string { |
|
|
type (
|
|
|
TableAppendRequest struct {
|
|
|
//MasterTableId string `json:"masterTableId"`
|
|
|
OriginalTableId string `json:"originalTableId"`
|
|
|
CheckoutTableFileUrl string `json:"checkoutTableFileUrl"`
|
|
|
DatabaseTableName string `json:"databaseTableName"`
|
|
|
ColumnSchemas []domain.ColumnSchema `json:"columnSchemas"`
|
|
|
FieldSchemas []FieldSchema `json:"fieldSchemas"`
|
|
|
OriginalTableId string `json:"originalTableId"`
|
|
|
CheckoutTableFileUrl string `json:"checkoutTableFileUrl"`
|
|
|
DatabaseTableName string `json:"databaseTableName"`
|
|
|
ColumnSchemas []domain.ColumnSchema `json:"columnSchemas"`
|
|
|
FieldSchemas []FieldSchema `json:"fieldSchemas"`
|
|
|
SchemaMap map[string]domain.ColumnSchema `json:"schemaMap"`
|
|
|
}
|
|
|
|
|
|
MasterTablesAppendRequest struct {
|
...
|
...
|
@@ -228,17 +229,24 @@ type ( |
|
|
)
|
|
|
|
|
|
func NewTableAppendRequest(param domain.ReqAppendData) TableAppendRequest {
|
|
|
columnSchemas := DomainFieldsToColumnSchemas(param.From)
|
|
|
req := TableAppendRequest{
|
|
|
OriginalTableId: intToString(param.FileId),
|
|
|
CheckoutTableFileUrl: param.FileUrl,
|
|
|
DatabaseTableName: param.Table.SQLName,
|
|
|
ColumnSchemas: DomainFieldsToColumnSchemas(param.Table.DataFields),
|
|
|
ColumnSchemas: DomainFieldsToColumnSchemas(param.ExcelTable.DataFields),
|
|
|
FieldSchemas: ToFieldSchemas(param.Table.DataFields),
|
|
|
SchemaMap: make(map[string]domain.ColumnSchema),
|
|
|
}
|
|
|
if len(param.From) > 0 {
|
|
|
req.ColumnSchemas = DomainFieldsToColumnSchemas(param.From)
|
|
|
req.FieldSchemas = ToFieldSchemas(param.To)
|
|
|
for i := 0; i < len(param.To); i++ {
|
|
|
if len(columnSchemas) > i {
|
|
|
req.SchemaMap[param.To[i].SQLName] = columnSchemas[i]
|
|
|
}
|
|
|
}
|
|
|
//if len(param.From) > 0 {
|
|
|
// req.ColumnSchemas = DomainFieldsToColumnSchemas(param.From)
|
|
|
// req.FieldSchemas = ToFieldSchemas(param.To)
|
|
|
//}
|
|
|
return req
|
|
|
}
|
|
|
|
...
|
...
|
|