From 1ca4879df9cc3c22181b2a200aa4b793116d3d35 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期六, 19 十月 2024 16:23:55 +0800 Subject: [PATCH] fix id --- service/server.go | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/service/server.go b/service/server.go index 3f56b0b..6f15812 100644 --- a/service/server.go +++ b/service/server.go @@ -65,7 +65,7 @@ return totals, nil } -func GetData() (interface{}, error) { +func GetData() (*model.PushDataInfoV2, error) { //fmt.Println(config.Options.EsUrl) //fmt.Println(config.Options.ServerUrl) url := "http://" + config.Options.EsUrl + "/ai_face_ocean/_search" @@ -137,10 +137,10 @@ return nil, errors.New("鑾峰彇灏忓浘鏁版嵁澶辫触, id:" + esInfoV2.Id) } - var pushData = model.PushDataInfoV2 + var pushData = new(model.PushDataInfoV2) pushData.CameraId = esInfoV2.CameraId pushData.PicDate = esInfoV2.PicDate - pushData.PicId = esInfoV2.PicId + pushData.PicId = esInfoV2.Id pushData.CameraFloor = esInfoV2.CameraLocation.Floor pushData.Direction = esInfoV2.CameraLocation.Direction pushData.PicMaxImages = append(pushData.PicMaxImages, picMaxImages) @@ -193,7 +193,7 @@ } func DeleteData(id string) bool { - url := "http://" + config.Options.EsUrl + "/ai_ocean/_delete_by_query?refresh=true" + url := "http://" + config.Options.EsUrl + "/ai_face_ocean/_delete_by_query?refresh=true" deleteDSL := `{ "query":{ "bool":{ @@ -220,7 +220,7 @@ } func MarkData(id string) bool { - url := "http://" + config.Options.EsUrl + "/ai_ocean/_update_by_query?refresh=true" + url := "http://" + config.Options.EsUrl + "/ai_face_ocean/_update_by_query?refresh=true" markDSL := `{ "script": { "source": "ctx._source.isDelete=true" -- Gitblit v1.8.0