controllers/dbtableperson.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
controllers/esSearch.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
controllers/task.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
go.mod | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
go.sum | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
router/router.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
controllers/dbtableperson.go
@@ -21,6 +21,8 @@ "webserver/extend/esutil" "webserver/extend/util" "webserver/models" esApi "basic.com/pubsub/esutil.git" ) type DbPersonController struct { @@ -484,6 +486,58 @@ } } type JoinDbTVo struct { CaptureId string `json:"captureId"` TableIds []string `json:"tableIds"` } // @Summary 抓拍人员加入底库 // @Description 抓拍人员加入底库 // @Accept json // @Produce json // @Tags es // @Param obj body controllers.JoinDbTVo true "底库数据" // @Success 200 {string} json "{"code":200, msg:"目录结构数据", success:true}" // @Failure 500 {string} json "{"code":500, msg:"返回错误信息", success:false}" // @Router /data/api-v/dbperson/joinDbTable [POST] func (sc *DbPersonController) JoinDbTable(c *gin.Context) { var reqBody JoinDbTVo c.BindJSON(&reqBody) if reqBody.CaptureId == "" || len(reqBody.TableIds) ==0 { util.ResponseFormat(c,code.RequestParamError, "参数有误") return } localConf, err := cache.GetServerInfo() if err !=nil || localConf.AlarmIp == "" || localConf.AlarmPort <=0 { util.ResponseFormat(c,code.ComError,"报警设置有误") return } videopersons, e := esApi.Videopersonsinfosbyid([]string{reqBody.CaptureId}, config.EsInfo.EsIndex.VideoPersons.IndexName, localConf.AlarmIp, strconv.Itoa(int(localConf.AlarmPort))) if e ==nil && videopersons !=nil && len(videopersons) == 1{ var personPicUrl = ""//人脸图片 var feature = ""//特征 if videopersons[0].PicSmUrl !=nil && len(videopersons[0].PicSmUrl) >0 { personPicUrl = videopersons[0].PicSmUrl[0] } fea, e2 := esApi.GetVideoPersonFaceFeatureById(reqBody.CaptureId, config.EsInfo.EsIndex.VideoPersons.IndexName, localConf.AlarmIp, strconv.Itoa(int(localConf.AlarmPort))) if e2 == nil && fea !="" { feature = fea } if personPicUrl != "" && feature != "" { var dbpApi dbapi.DbPersonApi b,d := dbpApi.JoinDbTable(reqBody.TableIds, feature, personPicUrl) if b { util.ResponseFormat(c,code.Success,d) return } else { util.ResponseFormat(c,code.ComError,"加入失败") return } } } util.ResponseFormat(c,code.ComError,"加入失败") } type DbtSearch struct { TableId string `json:"tableId"` OrderName string `json:"orderName"` controllers/esSearch.go
@@ -1,19 +1,19 @@ package controllers package controllers import ( "basic.com/dbapi.git" "fmt" "github.com/gin-gonic/gin" "strconv" "strings" "webserver/cache" "webserver/extend/code" "webserver/extend/config" "webserver/extend/esutil" "basic.com/valib/logger.git" "webserver/extend/util" "webserver/models" ) import ( "basic.com/dbapi.git" "basic.com/valib/logger.git" "fmt" "github.com/gin-gonic/gin" "strconv" "strings" "webserver/cache" "webserver/extend/code" "webserver/extend/config" "webserver/extend/esutil" "webserver/extend/util" "webserver/models" ) type EsSearchController struct{} controllers/task.go
@@ -105,9 +105,11 @@ if e==nil && esTaskM !=nil { for _,tM :=range esTaskM { if _,ok := m[tM["taskId"].(string)];!ok {//表示此任务已被删除 taskId := tM["taskId"].(string) m[taskId] = taskId tasks = append(tasks, TaskSdkVo{ Task:TaskVo{ Taskid: tM["taskId"].(string), Taskid: taskId, Taskname: tM["taskName"].(string), DelFlag: true, }, go.mod
@@ -3,7 +3,7 @@ go 1.12 require ( basic.com/dbapi.git v0.0.0-20191028130548-872f0d29a2d3 // indirect basic.com/dbapi.git v0.0.0-20191029073251-acc3826d096d // indirect basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb // indirect basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 // indirect basic.com/pubsub/esutil.git v0.0.0-20191029031958-4ab66414c6d1 // indirect go.sum
@@ -1,5 +1,5 @@ basic.com/dbapi.git v0.0.0-20191028130548-872f0d29a2d3 h1:oM/P/GEUMXGX6Ig1Why0rdkbm82cG5BWWb0DQNrw760= basic.com/dbapi.git v0.0.0-20191028130548-872f0d29a2d3/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= basic.com/dbapi.git v0.0.0-20191029073251-acc3826d096d h1:DhbWFpg4/KLeYbMpaLJUlY/z5mSyCx+kPh9JY7OMd2k= basic.com/dbapi.git v0.0.0-20191029073251-acc3826d096d/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb h1:fM6DojeInFSCFO+wkba1jtyPiSDqw0jYKi4Tk+e+ka4= basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb/go.mod h1:FTryK8BsVLfUplx8a3+l8hJWub6VbAWZCUH7sPRZaso= basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 h1:BBA30Rgljn6MRieC4gUncETJDyna3ObyubTo9HEQ2M0= router/router.go
@@ -184,6 +184,8 @@ vdbperson.POST("/faceExtract", fileController.FaceExtract) vdbperson.POST("/searchByPhoto", fileController.SearchByPhoto) vdbperson.POST("/updateFace", dbPersonCont.UpdateFace) vdbperson.POST("/joinDbTable", dbPersonCont.JoinDbTable) } // 系统设置 操作