edb_refresh_source.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. SourceNameEn string `description:"英文来源名称"`
  18. SubSourceNameEn string `description:"英文子来源名称"`
  19. }
  20. // EdbRefreshSourceList
  21. // @Description: 获取刷新的数据源列表
  22. type EdbRefreshSourceList struct {
  23. Source int `orm:"column(source)" description:"来源"`
  24. SourceName string `description:"来源名称"`
  25. SubSource int `description:"子数据来源:0:经济数据库,1:日期序列"`
  26. SubSourceName string `description:"子来源名称"`
  27. Child []EdbRefreshSourceList `description:"子来源"`
  28. HasChild int `description:"是否有子来源,0:否,1:是"`
  29. SourceNameEn string `description:"英文来源名称"`
  30. SubSourceNameEn string `description:"英文子来源名称"`
  31. }
  32. // GetAllList
  33. // @Description: 获取刷新数据源列表
  34. // @author: Roc
  35. // @datetime 2024-01-03 15:03:24
  36. // @return items []*EdbRefreshSource
  37. // @return err error
  38. func (m EdbRefreshSource) GetAllList() (items []*EdbRefreshSource, err error) {
  39. o := orm.NewOrmUsingDB("data")
  40. sql := ` SELECT * FROM edb_refresh_source ORDER BY id ASC `
  41. _, err = o.Raw(sql).QueryRows(&items)
  42. return
  43. }
  44. type BaseClassifyItems struct {
  45. ClassifyId int `description:"分类id"`
  46. ClassifyName string `description:"分类名称"`
  47. ParentId int `description:"父级id"`
  48. UniqueCode string `description:"唯一编码"`
  49. Children []*BaseClassifyItems `description:"下级"`
  50. }