From 41ac67f13587ff76631167d6050c3f27f7b97c2a Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期二, 15 十月 2019 18:55:21 +0800
Subject: [PATCH] rm no use config
---
controllers/dbtableperson.go | 58 +++++++++++++++++++++++++++++++++-------------------------
1 files changed, 33 insertions(+), 25 deletions(-)
diff --git a/controllers/dbtableperson.go b/controllers/dbtableperson.go
index ac89321..c96ed64 100644
--- a/controllers/dbtableperson.go
+++ b/controllers/dbtableperson.go
@@ -129,15 +129,16 @@
} else {
faceB = face.FaceBytes
}
- var sysSetApi dbapi.SysSetApi
+
analyServerId := ""
- flag, sysconf := sysSetApi.GetServerInfo()
- if flag {
- analyServerId = sysconf.ServerId
+ conf, e := cache.GetServerInfo()
+ if e ==nil && conf.ServerId != "" {
+ analyServerId = conf.ServerId
} else {
util.ResponseFormat(c, code.ComError, "analyServerId涓虹┖锛岄厤缃湁璇�")
return
}
+
arg := protomsg.CompareArgs{
FaceFeature: faceB,
CompareThreshold: 0.6,
@@ -182,9 +183,9 @@
}
//濉厖鍚戝墠绔繑鍥炵殑鏁版嵁
-func FillDbPersonDataToCompareResult(compResult *protomsg.SdkCompareResult) []DbPersonVo {
+func FillDbPersonDataToCompareResult(compResult *protomsg.SdkCompareResult) []models.DbPersonsCompVo {
- var resultList = make([]DbPersonVo, len(compResult.CompareResult))
+ var resultList = make([]models.DbPersonsCompVo, len(compResult.CompareResult))
dbPersonM := make(map[string]ScoreIndex, 0)
personIds := make([]string,0)
@@ -204,25 +205,32 @@
}
if len(dbpersons) >0 {
- var dtApi dbapi.DbTableApi
+ //var dtApi dbapi.DbTableApi
for _,p :=range dbpersons {
- var dbP = DbPersonVo {
- PersonId: p.Id,
- IdCard: p.IdCard,
- CompareScore: util.ParseScore(dbPersonM[p.Id].CompareScore),
- MonitorLevel: p.MonitorLevel,
- PersonName: p.PersonName,
- PersonPicUrl: p.PersonPicUrl,
- PhoneNum: p.PhoneNum,
- Sex: p.Sex,
- TableId: p.TableId,
- Enable: p.Enable,
- }
- dbTableInfos, _ := dtApi.DbtablesById([]string{ p.TableId })
- if dbTableInfos !=nil{
- dbP.BwType = dbTableInfos[0].BwType
- dbP.TableName = dbTableInfos[0].TableName
- }
+ var dbP models.DbPersonsCompVo
+
+ dbP.Id = p.Id
+ dbP.TableId = p.TableId
+ dbP.FaceFeature = p.FaceFeature
+ dbP.PersonPicUrl = p.PersonPicUrl
+ dbP.PersonName = p.PersonName
+ dbP.Age = p.Age
+ dbP.Sex = p.Sex
+ dbP.IdCard = p.IdCard
+ dbP.PhoneNum = p.PhoneNum
+ dbP.MonitorLevel = p.MonitorLevel
+ dbP.Reserved = p.Reserved
+ dbP.IsDelete = int(p.IsDelete)
+ dbP.Enable = int(p.Enable)
+ dbP.CreateTime = p.CreateTime
+ dbP.UpdateTime = p.UpdateTime
+ dbP.CreateBy = p.CreateBy
+ dbP.CompareScore = util.ParseScore(dbPersonM[p.Id].CompareScore)
+ //dbTableInfos, _ := dtApi.DbtablesById([]string{ p.TableId })
+ //if dbTableInfos !=nil{
+ // dbP.BwType = dbTableInfos[0].BwType
+ // dbP.TableName = dbTableInfos[0].TableName
+ //}
resultList[dbPersonM[p.Id].Index] = dbP
}
}
@@ -313,7 +321,7 @@
func UpdateDbPersonsOfDbTable(id string) (message string) {
localConf, err2 := cache.GetServerInfo()
- if err2 !=nil || localConf.AlarmIp == "" {
+ if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
logger.Debug("localConfig is wrong!!!")
return "淇敼澶辫触"
}
--
Gitblit v1.8.0