...
|
...
|
@@ -7,13 +7,14 @@ import ( |
|
|
)
|
|
|
|
|
|
type RequestCheckoutTablesQuery struct {
|
|
|
OriginalTableId string `json:"originalTableId"`
|
|
|
IsFromOriginalTable bool `json:"isFromOriginalTable"`
|
|
|
TableFileUrl string `json:"tableFileUrl"`
|
|
|
ColumnSchemas []domain.ColumnSchema `json:"columnSchemas"`
|
|
|
PageNumber int `json:"pageNumber"`
|
|
|
PageSize int `json:"pageSize"`
|
|
|
QueryParameters []domain.QueryParameter `json:"queryParameters"`
|
|
|
OriginalTableId string `json:"originalTableId"`
|
|
|
IsFromOriginalTable bool `json:"isFromOriginalTable"`
|
|
|
TableFileUrl string `json:"tableFileUrl"`
|
|
|
TableFileUrlInternal string `json:"tableFileUrlInternal"`
|
|
|
ColumnSchemas []domain.ColumnSchema `json:"columnSchemas"`
|
|
|
PageNumber int `json:"pageNumber"`
|
|
|
PageSize int `json:"pageSize"`
|
|
|
QueryParameters []domain.QueryParameter `json:"queryParameters"`
|
|
|
//QueryParameters map[string]interface{} `json:"queryParameters"`
|
|
|
SortParameters map[string]interface{} `json:"sortParameters"`
|
|
|
HeaderRow int `json:"headerRow"`
|
...
|
...
|
@@ -42,12 +43,13 @@ func NewRequestCheckoutTablesQuery(param domain.ReqLoadDataTable) RequestCheckou |
|
|
isSourceFile = true
|
|
|
}
|
|
|
return RequestCheckoutTablesQuery{
|
|
|
OriginalTableId: param.OriginalTableId,
|
|
|
IsFromOriginalTable: isSourceFile,
|
|
|
TableFileUrl: tableFileUrl,
|
|
|
ColumnSchemas: param.ColumnSchemas,
|
|
|
PageNumber: param.PageNumber,
|
|
|
PageSize: param.PageSize,
|
|
|
OriginalTableId: param.OriginalTableId,
|
|
|
IsFromOriginalTable: isSourceFile,
|
|
|
TableFileUrl: domain.ConvertFileUrlToInternal(tableFileUrl),
|
|
|
TableFileUrlInternal: tableFileUrl,
|
|
|
ColumnSchemas: param.ColumnSchemas,
|
|
|
PageNumber: param.PageNumber,
|
|
|
PageSize: param.PageSize,
|
|
|
//QueryParameters: param.QueryParameters,
|
|
|
QueryParameters: make([]domain.QueryParameter, 0),
|
|
|
//QueryParameters: make(map[string]interface{}),
|
...
|
...
|
@@ -133,12 +135,13 @@ func ToDataLoadDataTable(data DataCheckoutTables) *domain.DataLoadDataTable { |
|
|
|
|
|
type (
|
|
|
RequestCheckoutTablesGenerateMasterTable struct {
|
|
|
OriginalTableId string `json:"originalTableId"`
|
|
|
CheckoutTableFileUrl string `json:"checkoutTableFileUrl"`
|
|
|
ColumnSchemas []domain.ColumnSchema `json:"columnSchemas"`
|
|
|
MasterTableName string `json:"masterTableName"`
|
|
|
FieldSchemas []FieldSchema `json:"fieldSchemas"`
|
|
|
KeyFieldEnNames []string `json:"keyFieldEnNames"`
|
|
|
OriginalTableId string `json:"originalTableId"`
|
|
|
CheckoutTableFileUrl string `json:"checkoutTableFileUrl"`
|
|
|
CheckoutTableFileUrlInternal string `json:"checkoutTableFileUrlInternal"`
|
|
|
ColumnSchemas []domain.ColumnSchema `json:"columnSchemas"`
|
|
|
MasterTableName string `json:"masterTableName"`
|
|
|
FieldSchemas []FieldSchema `json:"fieldSchemas"`
|
|
|
KeyFieldEnNames []string `json:"keyFieldEnNames"`
|
|
|
}
|
|
|
DataCheckoutTablesGenerateMasterTable struct {
|
|
|
MasterTableName string `json:"masterTableName"`
|
...
|
...
|
@@ -154,12 +157,13 @@ type ( |
|
|
|
|
|
func NewRequestCheckoutTablesGenerateMasterTable(param domain.ReqGenerateTable) RequestCheckoutTablesGenerateMasterTable {
|
|
|
request := RequestCheckoutTablesGenerateMasterTable{
|
|
|
OriginalTableId: fmt.Sprintf("%v", param.FileId),
|
|
|
CheckoutTableFileUrl: param.FileUrl,
|
|
|
ColumnSchemas: DomainFieldsToColumnSchemas(param.Table.DataFields),
|
|
|
MasterTableName: param.Table.SQLName,
|
|
|
FieldSchemas: ToFieldSchemas(param.Table.DataFields),
|
|
|
KeyFieldEnNames: []string{param.Table.PK.SQLName},
|
|
|
OriginalTableId: fmt.Sprintf("%v", param.FileId),
|
|
|
CheckoutTableFileUrl: domain.ConvertFileUrlToInternal(param.FileUrl),
|
|
|
CheckoutTableFileUrlInternal: param.FileUrl,
|
|
|
ColumnSchemas: DomainFieldsToColumnSchemas(param.Table.DataFields),
|
|
|
MasterTableName: param.Table.SQLName,
|
|
|
FieldSchemas: ToFieldSchemas(param.Table.DataFields),
|
|
|
KeyFieldEnNames: []string{param.Table.PK.SQLName},
|
|
|
}
|
|
|
return request
|
|
|
}
|
...
|
...
|
@@ -167,12 +171,13 @@ func NewRequestCheckoutTablesGenerateMasterTable(param domain.ReqGenerateTable) |
|
|
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"`
|
|
|
SchemaMap map[string]domain.ColumnSchema `json:"schemaMap"`
|
|
|
OriginalTableId string `json:"originalTableId"`
|
|
|
CheckoutTableFileUrl string `json:"checkoutTableFileUrl"`
|
|
|
CheckoutTableFileUrlInternal string `json:"checkoutTableFileUrlInternal"`
|
|
|
DatabaseTableName string `json:"databaseTableName"`
|
|
|
ColumnSchemas []domain.ColumnSchema `json:"columnSchemas"`
|
|
|
FieldSchemas []FieldSchema `json:"fieldSchemas"`
|
|
|
SchemaMap map[string]domain.ColumnSchema `json:"schemaMap"`
|
|
|
}
|
|
|
|
|
|
MasterTablesAppendRequest struct {
|
...
|
...
|
@@ -192,12 +197,13 @@ 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.ExcelTable.DataFields), //这里主要需要传递原文件所有字段 param.From
|
|
|
FieldSchemas: ToFieldSchemas(param.Table.DataFields),
|
|
|
SchemaMap: make(map[string]domain.ColumnSchema),
|
|
|
OriginalTableId: intToString(param.FileId),
|
|
|
CheckoutTableFileUrl: domain.ConvertFileUrlToInternal(param.FileUrl),
|
|
|
CheckoutTableFileUrlInternal: param.FileUrl,
|
|
|
DatabaseTableName: param.Table.SQLName,
|
|
|
ColumnSchemas: DomainFieldsToColumnSchemas(param.ExcelTable.DataFields), //这里主要需要传递原文件所有字段 param.From
|
|
|
FieldSchemas: ToFieldSchemas(param.Table.DataFields),
|
|
|
SchemaMap: make(map[string]domain.ColumnSchema),
|
|
|
}
|
|
|
for i := 0; i < len(param.To); i++ {
|
|
|
if len(columnSchemas) > i {
|
...
|
...
|
|