| | |
| | | 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" |
| | |
| | | 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) |
| | |
| | | } |
| | | |
| | | 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":{ |
| | |
| | | } |
| | | |
| | | 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" |