edb_refresh_source.go 2.0 KB

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