...
|
...
|
@@ -176,9 +176,13 @@ func (tableService *TableService) GenerateBusinessTable(ctx *domain.Context, cmd |
|
|
hasPkField = true
|
|
|
continue
|
|
|
}
|
|
|
var filedName = ""
|
|
|
if cmd.ShowTableFieldNameBy == 0 {
|
|
|
filedName = f.FieldEnName
|
|
|
}
|
|
|
fields = append(fields, &domain.Field{
|
|
|
Index: i + 1,
|
|
|
Name: f.FieldZhName,
|
|
|
Name: filedName,
|
|
|
SQLName: f.FieldEnName,
|
|
|
SQLType: f.FieldType, //TODO:类型转换
|
|
|
Flag: domain.MainTableField,
|
...
|
...
|
@@ -187,7 +191,11 @@ func (tableService *TableService) GenerateBusinessTable(ctx *domain.Context, cmd |
|
|
if !hasPkField {
|
|
|
return nil, factory.FastError(fmt.Errorf("业务表未包含字段 `id`"))
|
|
|
}
|
|
|
mainTable = domainService.NewTable(domain.MainTable, cmd.TableName, fields, 0).
|
|
|
var tableName = cmd.TableName
|
|
|
if cmd.ShowTableNameBy == 0 {
|
|
|
tableName = cmd.TableFullName
|
|
|
}
|
|
|
mainTable = domainService.NewTable(domain.MainTable, tableName, fields, 0).
|
|
|
WithContext(ctx).
|
|
|
WithPrefix(domain.MainTable.ToString()).ApplyDefaultModule()
|
|
|
mainTable.SQLName = cmd.TableFullName
|
...
|
...
|
|