...
|
...
|
@@ -255,6 +255,7 @@ type ( |
|
|
ReplicationTableName string `json:"replicationTableName"`
|
|
|
FieldSchemas []FieldSchema `json:"fieldSchemas"`
|
|
|
KeyFieldEnNames []string `json:"keyFieldEnNames"`
|
|
|
ManuallyFieldSchemas []FieldSchema `json:"manuallyFieldSchemas"`
|
|
|
}
|
|
|
|
|
|
CopyTableResponse struct{}
|
...
|
...
|
@@ -272,11 +273,13 @@ type ( |
|
|
|
|
|
func NewCopyTableRequest(param domain.ReqCopyTable) CopyTableRequest {
|
|
|
var tableType string
|
|
|
var manuallyFieldSchemas = make([]FieldSchema, 0)
|
|
|
switch param.Table.TableType {
|
|
|
case domain.MainTable.ToString():
|
|
|
tableType = "master"
|
|
|
case domain.SubTable.ToString():
|
|
|
tableType = "split"
|
|
|
manuallyFieldSchemas = ToFieldSchemas(param.Table.ManualFields)
|
|
|
case domain.SideTable.ToString():
|
|
|
tableType = "replication"
|
|
|
}
|
...
|
...
|
@@ -284,8 +287,9 @@ func NewCopyTableRequest(param domain.ReqCopyTable) CopyTableRequest { |
|
|
DatabaseTableName: param.Table.SQLName,
|
|
|
DatabaseTableType: tableType,
|
|
|
ReplicationTableName: param.CopyToTable.SQLName,
|
|
|
FieldSchemas: ToFieldSchemas(param.CopyToTable.DataFields),
|
|
|
FieldSchemas: ToFieldSchemas(param.Table.DataFields),
|
|
|
KeyFieldEnNames: []string{param.Table.PK.SQLName},
|
|
|
ManuallyFieldSchemas: manuallyFieldSchemas,
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|