package response

import (
	"eta/eta_mobile/models/data_manage"
	"eta/eta_mobile/models/data_manage/line_feature/request"
)

// PreviewMultipleGraphConfigResp 预览
type PreviewMultipleGraphConfigResp struct {
	CurveData                 interface{} `description:"曲线图数据"`
	StandardDeviationData     interface{} `description:"标准差数据"`
	PercentileData            interface{} `description:"百分位数据"`
	FrequencyDistributionData interface{} `description:"频率分布数据"`
}

type CurveResp struct {
	ChartInfo   data_manage.ChartInfoView
	EdbInfoList []data_manage.ChartEdbInfoMapping
	DataResp    interface{}
}

// LineFeatureDataResp 曲线图的一些数据返回
type LineFeatureDataResp struct {
	MaxData             float64
	MinData             float64
	LatestDate          string `description:"真实数据的最后日期"`
	EdbInfoCategoryType int
	ChartColor          string
	ChartStyle          string
	PredictChartColor   string
	ChartType           int
	ChartWidth          float64
	EdbName             string
	EdbNameEn           string
	Unit                string
	UnitEn              string
	IsAxis              int
	DataList            []data_manage.EdbDataList
}

// FrequencyDistributionResp 频率分布图数据
type FrequencyDistributionResp struct {
	LeftMinValue  float64
	LeftMaxValue  float64
	RightMinValue float64
	RightMaxValue float64
	DataList      []FrequencyDistributionData
}

// FrequencyDistributionData 频率分布的值
type FrequencyDistributionData struct {
	Name   string      `description:"别名"`
	NameEn string      `description:"英文别名"`
	Unit   string      `description:"单位"`
	UnitEn string      `description:"单位别名"`
	Value  interface{} `description:"每个指标的值"`
	Color  string      `description:"数据颜色"`
	IsAxis int         `description:"1:左轴,0:右轴"`
}

// FrequencyDistributionYData 频率分布的实际数据
type FrequencyDistributionYData struct {
	X float64
	Y float64
}

type ChartInfoResp struct {
	List []ChartDataResp `description:"数据列表"`
}

// ChartDataResp 图表数据
type ChartDataResp struct {
	LatestDate          string  `description:"真实数据的日期"`
	Name                string  `description:"名称"`
	NameEn              string  `description:"英文名称"`
	EdbInfoCategoryType int     `description:"普通数据还是预测数据，0：普通，1：预测"`
	MaxData             float64 `description:"最大值"`
	MinData             float64 `description:"最小值"`
	DataList            []data_manage.EdbDataList
}

// MultipleGraphConfigDetailResp 配置详情接口返回
type MultipleGraphConfigDetailResp struct {
	MultipleGraphConfigId int
	Curve                 request.CurveConfig           `description:"曲线图配置"`
	StandardDeviation     request.StandardDeviation     `description:"标准差配置"`
	Percentile            request.Percentile            `description:"百分位配置"`
	FrequencyDistribution request.FrequencyDistribution `description:"频率分布配置"`
	EdbInfoList           []*data_manage.ChartEdbInfoMapping
	ChartMappingList      []MultipleGraphConfigChartMapping `description:"关联图表"`
	EdbMappingList        []MultipleGraphConfigEdbMapping   `description:"关联指标"`
}
type MultipleGraphConfigChartMapping struct {
	ChartInfoId            int    `description:"图表id"`
	Source                 int    `description:"来源,1:曲线图，8：标准差图表；9：百分位图表；10：频率分布图表；"`
	MultipleLocationSource int    `description:"来源,1:曲线图，8：标准差图表；9：百分位图表；10：频率分布图表；"`
	ChartName              string `description:"图表名称"`
	ChartClassifyId        int    `description:"图表分类id"`
}
type MultipleGraphConfigEdbMapping struct {
	EdbInfoId              int `description:"图表id"`
	Source                 int `description:"来源,1:曲线图，8：标准差图表；9：百分位图表；10：频率分布图表；"`
	MultipleLocationSource int `description:"来源,1:曲线图，8：标准差图表；9：百分位图表；10：频率分布图表；"`
}
