model.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package chart_info_correlation
  2. import "hongze/hongze_yb/global"
  3. // GetItemById 主键获取
  4. func (m *ChartInfoCorrelation) GetItemById(primaryId int) (err error) {
  5. err = global.MYSQL["data"].Model(m).
  6. Where("correlation_chart_info_id = ?", primaryId).
  7. First(&m).Error
  8. return
  9. }
  10. func (m *ChartInfoCorrelation) Update(updateCols []string) (err error) {
  11. err = global.MYSQL["data"].Model(m).Select(updateCols).Updates(*m).Error
  12. return
  13. }
  14. // CorrelationChartLegend 相关性图表图例
  15. type CorrelationChartLegend struct {
  16. LegendName string `description:"图例名称"`
  17. Color string `description:"图例颜色"`
  18. EdbInfoId int `description:"指标ID"`
  19. SeriesId int `description:"因子指标系列ID"`
  20. }
  21. // CorrelationSeriesEdbReq 指标系列
  22. type CorrelationSeriesEdbReq struct {
  23. EdbInfoId int `description:"指标ID"`
  24. SeriesId int `description:"因子指标系列ID"`
  25. }
  26. // CorrelationChartInfoExtraConfig 相关性图表额外设置
  27. type CorrelationChartInfoExtraConfig struct {
  28. LegendConfig []*CorrelationChartLegend `description:"图例设置"`
  29. }