edb_refresh_source.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package edb_refresh
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // EdbRefreshSource
  7. // @Description: 刷新的数据源表
  8. type EdbRefreshSource struct {
  9. Id int `orm:"column(id);pk"`
  10. Source int `orm:"column(source)" description:"来源"`
  11. SourceName string `description:"来源名称"`
  12. SubSource int `description:"子数据来源:0:经济数据库,1:日期序列"`
  13. SubSourceName string `description:"子来源名称"`
  14. HasChild int `description:"是否有子来源,0:否,1:是"`
  15. ModifyTime time.Time `description:"修改时间"`
  16. CreateTime time.Time `description:"创建时间"`
  17. }
  18. // EdbRefreshSourceList
  19. // @Description: 获取刷新的数据源列表
  20. type EdbRefreshSourceList struct {
  21. Source int `orm:"column(source)" 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. o := orm.NewOrmUsingDB("data")
  36. sql := ` SELECT * FROM edb_refresh_source ORDER BY id ASC `
  37. _, err = o.Raw(sql).QueryRows(&items)
  38. return
  39. }
  40. type BaseClassifyItems struct {
  41. ClassifyId int `description:"分类id"`
  42. ClassifyName string `description:"分类名称"`
  43. ParentId int `description:"父级id"`
  44. UniqueCode string `description:"唯一编码"`
  45. Children []*BaseClassifyItems `description:"下级"`
  46. }