sunty
2019-12-17 2cf0ea9c465baaf9b8e8368db65a20f632ed4ecc
add err
1个文件已修改
14 ■■■■ 已修改文件
EsApi.go 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EsApi.go
@@ -125,7 +125,7 @@
}
//根据抓拍人员id更新(videourl)摄像机地址
func UpdateVideourlById(id string, videoUrl string, indexName string, serverIp string, serverPort string, command int) (statu int) {
func UpdateVideourlById(id string, videoUrl string, indexName string, serverIp string, serverPort string, command int) (statu int,err error) {
    var info interface{}
    url := "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_update_by_query?refresh=true"
@@ -150,7 +150,7 @@
    if err != nil {
        fmt.Println("http request videoUrlInfo info is err!")
        statu = 500
        return
        return statu,err
    }
    json.Unmarshal(buf, &info)
    //fmt.Println(info)
@@ -158,23 +158,23 @@
    if !ok {
        fmt.Println("http response interface can not change map[string]interface{}")
        statu = 500
        return
        return statu,errors.New("http response interface can not change map[string]interface{}")
    }
    middle, ok := out["updated"].(float64)
    if !ok {
        fmt.Println("first updated change error!")
        statu = 500
        return
        return statu,errors.New("first updated change error!")
    }
    if middle == 1 {
        statu = 200
        return
        return statu,nil
    }
    if middle == 0 {
        statu = 201
        return
        return statu,errors.New("已经修改")
    }
    return statu
    return statu,nil
}
//获取当前节点抓拍库所有人员ID*缓存*