作者 yangfu

feat: add column sql name

... ... @@ -234,6 +234,18 @@ func (tableService *TableService) Search(searchQuery *query.SearchTableQuery) (i
for _, table := range tables {
var item = &dto.TableDto{}
item.Load(table)
if len(searchQuery.ExcludeTables) > 0 {
exclude := false
for _, t := range searchQuery.ExcludeTables {
if t == item.TableId {
exclude = true
break
}
}
if exclude {
continue
}
}
if searchQuery.ReturnDetailStructInfo {
item.SetDetailStructInfo(table)
}
... ...
... ... @@ -219,6 +219,7 @@ type (
type ColumnSchema struct {
ColumnName string `json:"columnName"`
ColumnType string `json:"columnType"`
ColumnSqlFriendlyName string `json:"columnSqlFriendlyName"`
}
func ToFields(fields []*Field) []*Field {
... ...
... ... @@ -8,6 +8,7 @@ func DomainFieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema {
res := domain.ColumnSchema{
ColumnName: f.Name,
ColumnType: f.SQLType,
ColumnSqlFriendlyName: f.SQLName,
}
if convertFiledSQLType(f.SQLType) {
res.ColumnType = domain.DECIMAL279.ToString()
... ... @@ -77,6 +78,7 @@ func FieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema {
result = append(result, domain.ColumnSchema{
ColumnName: f.Name,
ColumnType: f.SQLType,
ColumnSqlFriendlyName: f.SQLName,
})
}
return result
... ...