package sci99

// DataItem 定义了数据项的结构
type DataItem struct {
	DataTemplate        string          `json:"DataTemplate"`
	ProductName         string          `json:"ProductName"`
	ProductID           int             `json:"ProductID"`
	Region              string          `json:"Region"`
	Area                string          `json:"Area"`
	MarketSampleName    string          `json:"MarketSampleName"`
	Model               string          `json:"Model"`
	FactorySampleName   string          `json:"FactorySampleName"`
	DataTypeName        string          `json:"DataTypeName"`
	DataTypeID          int             `json:"DataTypeID"`
	Order               int             `json:"Order"`
	Unit                string          `json:"Unit"`
	DataName            string          `json:"DataName"`
	DIID                int             `json:"DIID"`
	Gid                 string          `json:"Gid"`
	PriceProduct        *string         `json:"PriceProduct"` // 使用指针以处理null值
	PriceProductID      int             `json:"PriceProductID"`
	PriceType           string          `json:"PriceType"`
	PriceTypeID         int             `json:"PriceTypeID"`
	PriceCondition      string          `json:"PriceCondition"`
	TradeTerms          string          `json:"TradeTerms"`
	DataStatus          int             `json:"DataStatus"`
	Cycle               string          `json:"Cycle"`
	DataModelName       string          `json:"DataModelName"`
	TimeMarkID          int             `json:"TimeMarkID"`
	Digits              int             `json:"Digits"`
	Model_zh            string          `json:"Model_zh"`
	Province            string          `json:"Province"`
	Payment             string          `json:"Payment"`
	PickModel           string          `json:"PickModel"`
	Tax                 string          `json:"Tax"`
	PackModel           string          `json:"PackModel"`
	TransModel          string          `json:"TransModel"`
	BalanceModel        string          `json:"BalanceModel"`
	EName               string          `json:"EName"`
	GasRate             string          `json:"GasRate"`
	FromArea            string          `json:"FromArea"`
	DIHistory           []DIHistoryItem `json:"DIHistory"`
	Purpose             string          `json:"Purpose"`
	FuturesMark         string          `json:"FuturesMark"`
	City                string          `json:"City"`
	MainShippers        string          `json:"MainShippers"`
	PriceClassification string          `json:"PriceClassification"`
	FactoryID           int             `json:"FactoryID"`
	Stand               string          `json:"Stand"`
	Type                string          `json:"Type"`
	DItemDTypeID        int             `json:"DItemDTypeID"`
	Classify            string          `json:"Classify"`
	LockDateName        string          `json:"LockDateName"`
	DataItemName        string          `json:"DataItemName"`
}

// DIHistoryItem 定义了DIHistory中的每个项目的结构
type DIHistoryItem struct {
	TransModel          map[string]string `json:"TransModel"`
	SpecialData         map[string]string `json:"SpecialData"`
	LockTimeMarkID      int               `json:"LockTimeMarkID"`
	DataModelName       string            `json:"DataModelName"`
	Factory             map[string]string `json:"Factory"`
	Tax                 map[string]string `json:"Tax"`
	LockTimeMarkName    map[string]string `json:"LockTimeMarkName"`
	StartDate           string            `json:"StartDate"`
	NumeratorUnitID     int               `json:"NumeratorUnitID"`
	DenominatorUnitID   int               `json:"DenominatorUnitID"`
	FromArea            map[string]string `json:"FromArea"`
	PushTimeMarkID      int               `json:"PushTimeMarkID"`
	TradeTerms          map[string]string `json:"TradeTerms"`
	TimeMarkName        map[string]string `json:"TimeMarkName"`
	NumeratorUnitName   map[string]string `json:"NumeratorUnitName"`
	PushTimeMarkName    map[string]string `json:"PushTimeMarkName"`
	TimeMarkID          int               `json:"TimeMarkID"`
	PickModel           map[string]string `json:"PickModel"`
	EndDate             string            `json:"EndDate"`
	Market              map[string]string `json:"Market"`
	DenominatorUnitName map[string]string `json::"DenominatorUnitName"`
	Area                map[string]string `json:"Area"`
	Payment             map[string]string `json:"Payment"`
	FactorySampleName   map[string]string `json:"FactorySampleName"`
	PackModel           map[string]string `json:"PackModel"`
	DataModel           int               `json:"DataModel"`
	Model               map[string]string `json:"Model"`
	DecimalPoint        int               `json:"DecimalPoint"`
	BalanceModel        map[string]string `json:"BalanceModel"`
}

// List 定义了Data数组中的每个项目的结构
type List struct {
	DIID              int     `json:"DIID"`
	DataTypeID        int     `json:"DataTypeID"`
	InitialValue      float64 `json:"InitialValue"`
	EndingValue       float64 `json:"EndingValue"`
	LDataValue        float64 `json:"LDataValue"`
	HDataValue        float64 `json:"HDataValue"`
	MDataValue        float64 `json:"MDataValue"`
	Change            float64 `json:"Change"`
	ChangeRate        float64 `json:"ChangeRate"`
	AmplitudeValue    float64 `json:"AmplitudeValue"`
	Remark            *string `json:"Remark"` // 使用指针以处理null值
	DataDate          string  `json:"DataDate"`
	RealDate          string  `json:"realDate"`
	MarketSampleName  string  `json:"MarketSampleName"`
	FactorySampleName *string `json:"FactorySampleName"` // 使用指针以处理null值
	Model             string  `json:"Model"`
	Unit              string  `json:"Unit"`
	PriceCondition    string  `json:"PriceCondition"`
	Area              string  `json:"Area"`
	Province          string  `json:"Province"`
	City              string  `json:"City"`
	Region            string  `json:"Region"`
	LockState         string  `json:"LockState"`
}

// DetailResponse
type DetailResponse struct {
	Status int    `json:"status"`
	Msg    string `json:"msg"`
	Data   struct {
		DataItem   DataItem  `json:"DataItem"`
		UserPower  UserPower `json:"UserPower"`
		List       []List    `json:"List"`
		Privileged bool      `json:"Privileged"`
		Choice     string    `json:"choice"`
		LastDate   string    `json:"LastDate"`
		IsCollect  bool      `json:"IsCollect"`
		CollectId  string    `json:"collectId"`
	} `json:"data"`
}

// UserPower 定义了用户权限的结构
type UserPower struct {
	Start     string `json:"Start"`
	End       string `json:"End"`
	PowerType int    `json:"PowerType"`
	ProductID int    `json:"ProductID"`
	Ppid      int    `json:"Ppid"`
}