chart_info.go 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package chart_info
  2. import (
  3. "hongze/hongze_yb/models/request"
  4. responseModel "hongze/hongze_yb/models/response"
  5. "hongze/hongze_yb/models/tables/chart_edb_mapping"
  6. "hongze/hongze_yb/models/tables/chart_info"
  7. "time"
  8. )
  9. type ChartInfoDetailResp struct {
  10. ChartInfo *chart_info.ChartInfoView
  11. EdbInfoList []*chart_edb_mapping.ChartEdbInfoMappingList
  12. XEdbIdValue []int `description:"柱方图的x轴数据,指标id"`
  13. XDataList []XData `description:"商品价格曲线的X轴数据"`
  14. YDataList []YData `description:"柱方图的y轴数据"`
  15. MyChartInfo *responseModel.MyChartItem
  16. CorrelationChartInfo *CorrelationInfo `description:"相关性图表信息"`
  17. DataResp interface{} `description:"图表数据,根据图的类型而定的,没有确定的数据格式"`
  18. }
  19. type ChartLibChartInfoDetailResp struct {
  20. ChartInfo *chart_info.ChartInfoView
  21. EdbInfoList []*chart_edb_mapping.ChartEdbInfoMappingTimeString
  22. XEdbIdValue []int `description:"柱方图的x轴数据,指标id"`
  23. XDataList []XData `description:"商品价格曲线的X轴数据"`
  24. YDataList []YData `description:"柱方图的y轴数据"`
  25. CorrelationChartInfo *CorrelationInfo `description:"相关性图表信息"`
  26. DataResp interface{} `description:"图表数据,根据图的类型而定的,没有确定的数据格式"`
  27. WaterMark string `description:"水印"`
  28. }
  29. // XData 商品价格曲线的的x轴数据
  30. type XData struct {
  31. Name string `description:"别名"`
  32. NameEn string `description:"英文别名"`
  33. }
  34. // YData 柱方图的y轴数据
  35. type YData struct {
  36. Date string `description:"数据日期"`
  37. ConfigDate time.Time `description:"配置的日期" json:"-"`
  38. Color string `description:"数据颜色"`
  39. Name string `description:"别名"`
  40. NameEn string `description:"英文别名"`
  41. Value []float64 `description:"每个指标的值"`
  42. NoDataEdbList []int `description:"没有数据的指标列表"`
  43. XEdbInfoIdList []int `description:"对应X轴的指标id列表"`
  44. EdbValMap map[int]float64 `description:"指标与值的对应" json:"-"`
  45. M []int `description:"对应开始日期的间隔值" json:"-"`
  46. NameList []string `description:"每个值对应的名称"`
  47. EnNameList []string `description:"每个值对应的英文名称"`
  48. SeriesEdb struct {
  49. SeriesId int `description:"因子指标系列ID"`
  50. EdbInfoId int `description:"指标ID"`
  51. } `description:"对应的系列指标"`
  52. }
  53. type CorrelationInfo struct {
  54. LeadValue int `description:"领先值"`
  55. LeadUnit string `description:"领先单位"`
  56. StartDate string `description:"开始日期"`
  57. EndDate string `description:"结束日期"`
  58. EdbInfoIdFirst int `description:"A指标ID"`
  59. EdbInfoIdSecond int `description:"B指标ID"`
  60. PeriodData string `description:"X轴-期数数据"`
  61. CorrelationData string `description:"Y轴-相关性系数"`
  62. AnalysisMode int `description:"分析模式: 0-单因子; 1-多因子"`
  63. }
  64. // RollingCorrelationChartDataResp 滚动相关性图
  65. type RollingCorrelationChartDataResp struct {
  66. XDateTimeValue []string `description:"滚动相关性图的x轴数据,日期数据"`
  67. YDataList []YData `description:"滚动相关性图的y轴数据"`
  68. }
  69. // ProfitFutureGoodChartResp 商品利润图
  70. type ProfitFutureGoodChartResp struct {
  71. XDataList []XData
  72. YDataList []YData
  73. ProfitName string `description:"利润的名称"`
  74. ProfitNameEn string `description:"利润的英文名称"`
  75. Extra request.ChartInfoReq `description:"柱方图的配置"`
  76. }
  77. // RadarChartInfoResp 雷达图数据
  78. type RadarChartInfoResp struct {
  79. YDataList []RadarYData `description:"数据列"`
  80. XEdbIdValue []int
  81. }
  82. // RadarYData 雷达图的y轴数据
  83. type RadarYData struct {
  84. Date string `description:"数据日期"`
  85. Color string `description:"数据颜色"`
  86. Name string `description:"别名"`
  87. Value []float64 `description:"每个指标的值"`
  88. }