尝试给上报到elasticsearch的文档加_id
This commit is contained in:
parent
c8f9cebc5b
commit
193ea03604
@ -18,6 +18,7 @@ import (
|
|||||||
|
|
||||||
type Candle struct {
|
type Candle struct {
|
||||||
core *Core
|
core *Core
|
||||||
|
Id string `json:"_id"`
|
||||||
InstId string
|
InstId string
|
||||||
Period string
|
Period string
|
||||||
Data []interface{}
|
Data []interface{}
|
||||||
@ -175,6 +176,7 @@ func Daoxu(arr []interface{}) {
|
|||||||
func (cl *Candle) ToStruct(core *Core) error {
|
func (cl *Candle) ToStruct(core *Core) error {
|
||||||
// cl.Timestamp
|
// cl.Timestamp
|
||||||
|
|
||||||
|
cl.Id = cl.InstId + "." + cl.Period + "." + cl.Data[0].(string)
|
||||||
// 将字符串转换为 int64 类型的时间戳
|
// 将字符串转换为 int64 类型的时间戳
|
||||||
ts, err := strconv.ParseInt(cl.Data[0].(string), 10, 64)
|
ts, err := strconv.ParseInt(cl.Data[0].(string), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user