作者 yangfu

feat: add column sql name

@@ -234,6 +234,18 @@ func (tableService *TableService) Search(searchQuery *query.SearchTableQuery) (i @@ -234,6 +234,18 @@ func (tableService *TableService) Search(searchQuery *query.SearchTableQuery) (i
234 for _, table := range tables { 234 for _, table := range tables {
235 var item = &dto.TableDto{} 235 var item = &dto.TableDto{}
236 item.Load(table) 236 item.Load(table)
  237 + if len(searchQuery.ExcludeTables) > 0 {
  238 + exclude := false
  239 + for _, t := range searchQuery.ExcludeTables {
  240 + if t == item.TableId {
  241 + exclude = true
  242 + break
  243 + }
  244 + }
  245 + if exclude {
  246 + continue
  247 + }
  248 + }
237 if searchQuery.ReturnDetailStructInfo { 249 if searchQuery.ReturnDetailStructInfo {
238 item.SetDetailStructInfo(table) 250 item.SetDetailStructInfo(table)
239 } 251 }
@@ -217,8 +217,9 @@ type ( @@ -217,8 +217,9 @@ type (
217 ) 217 )
218 218
219 type ColumnSchema struct { 219 type ColumnSchema struct {
220 - ColumnName string `json:"columnName"`  
221 - ColumnType string `json:"columnType"` 220 + ColumnName string `json:"columnName"`
  221 + ColumnType string `json:"columnType"`
  222 + ColumnSqlFriendlyName string `json:"columnSqlFriendlyName"`
222 } 223 }
223 224
224 func ToFields(fields []*Field) []*Field { 225 func ToFields(fields []*Field) []*Field {
@@ -6,8 +6,9 @@ func DomainFieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema { @@ -6,8 +6,9 @@ func DomainFieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema {
6 result := make([]domain.ColumnSchema, 0) 6 result := make([]domain.ColumnSchema, 0)
7 for _, f := range fields { 7 for _, f := range fields {
8 res := domain.ColumnSchema{ 8 res := domain.ColumnSchema{
9 - ColumnName: f.Name,  
10 - ColumnType: f.SQLType, 9 + ColumnName: f.Name,
  10 + ColumnType: f.SQLType,
  11 + ColumnSqlFriendlyName: f.SQLName,
11 } 12 }
12 if convertFiledSQLType(f.SQLType) { 13 if convertFiledSQLType(f.SQLType) {
13 res.ColumnType = domain.DECIMAL279.ToString() 14 res.ColumnType = domain.DECIMAL279.ToString()
@@ -75,8 +76,9 @@ func FieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema { @@ -75,8 +76,9 @@ func FieldsToColumnSchemas(fields []*domain.Field) []domain.ColumnSchema {
75 76
76 for _, f := range fields { 77 for _, f := range fields {
77 result = append(result, domain.ColumnSchema{ 78 result = append(result, domain.ColumnSchema{
78 - ColumnName: f.Name,  
79 - ColumnType: f.SQLType, 79 + ColumnName: f.Name,
  80 + ColumnType: f.SQLType,
  81 + ColumnSqlFriendlyName: f.SQLName,
80 }) 82 })
81 } 83 }
82 return result 84 return result