From d6db5df66c46e5b1435545127a7987797ab30641 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期三, 24 七月 2019 20:11:25 +0800 Subject: [PATCH] fix bug --- controllers/fileController.go | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/fileController.go b/controllers/fileController.go index e7e9381..fd631e1 100644 --- a/controllers/fileController.go +++ b/controllers/fileController.go @@ -139,7 +139,7 @@ urlArr = append(urlArr, weedFilePath) } } - //2.澶у浘鐢绘 + //2.澶у浘鐢绘,鏍囪瘑浜鸿劯浣嶇疆 originFilePath, _ := WeedFSClient.UploadFile(weedfsUri, "FaceUrl", fileBytes) resultMap["uploadImage"] = originFilePath resultMap["smImage"] = urlArr @@ -163,7 +163,7 @@ photoUrl := c.Request.FormValue("url") tableId := c.Request.FormValue("tableId")//搴曞簱id compThresholdStr := c.Request.FormValue("compThreshold")//姣斿闃堝�� - compThreshold, err := strconv.Atoi(compThresholdStr) + compThreshold, err := strconv.ParseFloat(compThresholdStr,32) if photoUrl == "" || err != nil { util.ResponseFormat(c, code.RequestParamError, "鍙傛暟鏈夎") return @@ -173,10 +173,12 @@ return } else { arg := protomsg.CompareArgs{ - TableIds:[]string{ tableId }, FaceFeature:face.FaceBytes, CompareThreshold:float32(compThreshold), } + if tableId !=""{ + arg.TableIds = []string{ tableId } + } b, err := proto.Marshal(&arg) if err !=nil{ util.ResponseFormat(c, code.ComError, "璇锋眰marshal澶辫触") -- Gitblit v1.8.0