作者 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)
}
... ...
... ... @@ -217,8 +217,9 @@ type (
)
type ColumnSchema struct {
ColumnName string `json:"columnName"`
ColumnType string `json:"columnType"`
ColumnName string `json:"columnName"`
ColumnType string `json:"columnType"`
ColumnSqlFriendlyName string `json:"columnSqlFriendlyName"`
}
func ToFields(fields []*Field) []*Field {
... ...
... ... @@ -6,8 +6,9 @@ func DomainFieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema {
result := make([]domain.ColumnSchema, 0)
for _, f := range fields {
res := domain.ColumnSchema{
ColumnName: f.Name,
ColumnType: f.SQLType,
ColumnName: f.Name,
ColumnType: f.SQLType,
ColumnSqlFriendlyName: f.SQLName,
}
if convertFiledSQLType(f.SQLType) {
res.ColumnType = domain.DECIMAL279.ToString()
... ... @@ -75,8 +76,9 @@ func FieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema {
for _, f := range fields {
result = append(result, domain.ColumnSchema{
ColumnName: f.Name,
ColumnType: f.SQLType,
ColumnName: f.Name,
ColumnType: f.SQLType,
ColumnSqlFriendlyName: f.SQLName,
})
}
return result
... ...