tickerInfo Id chagne

This commit is contained in:
zhangkun 2024-12-23 14:28:03 +08:00
parent 63deadbd5d
commit d3c99b32f2

View File

@ -9,7 +9,7 @@ import (
type TickerInfo struct { type TickerInfo struct {
Id string `json:"_id"` Id string `json:"_id"`
InstId string `json:"instId"` InstID string `json:"instId"`
Last float64 `json:"last"` Last float64 `json:"last"`
InstType string `json:"instType"` InstType string `json:"instType"`
VolCcy24h float64 `json:"volCcy24h"` VolCcy24h float64 `json:"volCcy24h"`
@ -17,7 +17,7 @@ type TickerInfo struct {
} }
type TickerInfoResp struct { type TickerInfoResp struct {
InstId string `json:"instId"` InstID string `json:"instId"`
Last string `json:"last"` Last string `json:"last"`
InstType string `json:"instType"` InstType string `json:"instType"`
VolCcy24h string `json:"volCcy24h"` VolCcy24h string `json:"volCcy24h"`
@ -26,8 +26,8 @@ type TickerInfoResp struct {
func (tir *TickerInfoResp) Convert() TickerInfo { func (tir *TickerInfoResp) Convert() TickerInfo {
ti := TickerInfo{ ti := TickerInfo{
Id: HashString(tir.InstId + tir.Ts), Id: HashString(tir.InstID + tir.Ts),
InstId: tir.InstId, InstID: tir.InstID,
InstType: tir.InstType, InstType: tir.InstType,
Last: ToFloat64(tir.Last), Last: ToFloat64(tir.Last),
VolCcy24h: ToFloat64(tir.VolCcy24h), VolCcy24h: ToFloat64(tir.VolCcy24h),