From 1f81a5838218b8b23a73e0a6a73a17968b4ef3f5 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期四, 25 七月 2019 14:58:04 +0800 Subject: [PATCH] fix searchByPhoto args --- controllers/fileController.go | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/controllers/fileController.go b/controllers/fileController.go index 29839f6..77cd804 100644 --- a/controllers/fileController.go +++ b/controllers/fileController.go @@ -181,9 +181,9 @@ var captureTable = "capturetable" // 鎶撴媿搴� type SearchCondition struct { - Url string `json:"url"` - TableIds []string `json:"tableIds"` - CompThreshold string `json:"compThreshold"` + PicUrl string `json:"picUrl"` + Databases []string `json:"databases"` + Threshold string `json:"threshold"` } // @Summary 浠ュ浘鎼滃浘 // @Description 浠ュ浘鎼滃浘 @@ -197,16 +197,16 @@ func (controller FileController) SearchByPhoto(c *gin.Context) { var condition SearchCondition err := c.BindJSON(&condition) - if err !=nil || condition.Url == "" { + if err !=nil || condition.PicUrl == "" { util.ResponseFormat(c, code.RequestParamError, "鍙傛暟鏈夎") return } - compThreshold, err := strconv.ParseFloat(condition.CompThreshold,32) - if condition.Url == "" || err != nil { + compThreshold, err := strconv.ParseFloat(condition.Threshold,32) + if condition.PicUrl == "" || err != nil { util.ResponseFormat(c, code.RequestParamError, "鍙傛暟鏈夎") return } - if face,ok := faceExtractedMap[condition.Url];!ok{ + if face,ok := faceExtractedMap[condition.PicUrl];!ok{ util.ResponseFormat(c, code.RequestParamError, "鍙傛暟鏈夎") return } else { @@ -215,8 +215,8 @@ FaceFeature:face.FaceBytes, CompareThreshold:float32(compThreshold), } - if condition.TableIds !=nil { - arg.TableIds = append(arg.TableIds, condition.TableIds...) + if condition.Databases !=nil { + arg.TableIds = append(arg.TableIds, condition.Databases...) } b, err := proto.Marshal(&arg) if err !=nil{ -- Gitblit v1.8.0