edb_refresh_source.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package edb_refresh
  2. import (
  3. "eta_gn/eta_index_lib/global"
  4. "time"
  5. )
  6. // EdbRefreshSource
  7. // @Description: 刷新的数据源表
  8. type EdbRefreshSource struct {
  9. Id int `gorm:"primaryKey;autoIncrement;column:id" description:"ID"`
  10. Source int `gorm:"column:source" description:"来源"`
  11. SourceName string `gorm:"column:source_name" description:"来源名称"`
  12. SubSource int `gorm:"column:sub_source" description:"子数据来源:0:经济数据库,1:日期序列"`
  13. SubSourceName string `gorm:"column:sub_source_name" description:"子来源名称"`
  14. HasChild int `gorm:"column:has_child" description:"是否有子来源,0:否,1:是"`
  15. ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
  16. CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
  17. }
  18. // EdbRefreshSourceList
  19. // @Description: 获取刷新的数据源列表
  20. type EdbRefreshSourceList struct {
  21. Source int `description:"来源"`
  22. SourceName string `description:"来源名称"`
  23. SubSource int `description:"子数据来源:0:经济数据库,1:日期序列"`
  24. SubSourceName string `description:"子来源名称"`
  25. Child []EdbRefreshSourceList `description:"子来源"`
  26. HasChild int `description:"是否有子来源,0:否,1:是"`
  27. }
  28. // GetAllList
  29. // @Description: 获取刷新数据源列表
  30. // @author: Roc
  31. // @datetime 2024-01-03 15:03:24
  32. // @return items []*EdbRefreshSource
  33. // @return err error
  34. func (m EdbRefreshSource) GetAllList() (items []*EdbRefreshSource, err error) {
  35. sql := ` SELECT * FROM edb_refresh_source ORDER BY id ASC `
  36. err = global.DEFAULT_DmSQL.Raw(sql).Scan(&items).Error
  37. return
  38. }
  39. type BaseClassifyItems struct {
  40. ClassifyId int `description:"分类id"`
  41. ClassifyName string `description:"分类名称"`
  42. ParentId int `description:"父级id"`
  43. UniqueCode string `description:"唯一编码"`
  44. Children []*BaseClassifyItems `description:"下级"`
  45. }