|
@ -77,7 +77,7 @@ func (the *Storage2Es) SaveTheme(dataList []common_models.EsTheme) { |
|
|
|
|
|
|
|
|
for _, theme := range dataList { |
|
|
for _, theme := range dataList { |
|
|
// scala => val id = UUID.nameUUIDFromBytes(s"${sd.station.id}-${sd.acqTime.getMillis}".getBytes("UTF-8")).toString
|
|
|
// scala => val id = UUID.nameUUIDFromBytes(s"${sd.station.id}-${sd.acqTime.getMillis}".getBytes("UTF-8")).toString
|
|
|
source, err := json.Marshal(theme) |
|
|
source, err := theme.MarshalJSON() //json.Marshal(theme)
|
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Printf("theme序列化异常,err=%s", err.Error()) |
|
|
log.Printf("theme序列化异常,err=%s", err.Error()) |
|
|
continue |
|
|
continue |
|
@ -110,7 +110,11 @@ func (the *Storage2Es) SaveVib(dataList []common_models.EsVbRaw) { |
|
|
func (the *Storage2Es) SaveGroupTheme(dataList []common_models.EsGroupTheme) { |
|
|
func (the *Storage2Es) SaveGroupTheme(dataList []common_models.EsGroupTheme) { |
|
|
body := strings.Builder{} |
|
|
body := strings.Builder{} |
|
|
for _, theme := range dataList { |
|
|
for _, theme := range dataList { |
|
|
source, _ := json.Marshal(theme) |
|
|
source, err := theme.MarshalJSON() //json.Marshal(theme)
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
log.Printf("group theme 序列化异常,err=%s", err.Error()) |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
_id := common_calc.NameUUIDFromString(fmt.Sprintf("%d-%d", theme.GroupId, theme.CollectTime.UnixMilli())) |
|
|
_id := common_calc.NameUUIDFromString(fmt.Sprintf("%d-%d", theme.GroupId, theme.CollectTime.UnixMilli())) |
|
|
s := fmt.Sprintf( |
|
|
s := fmt.Sprintf( |
|
|
`{"index": {"_index": "%s","_id": "%s"}} |
|
|
`{"index": {"_index": "%s","_id": "%s"}} |
|
|