From 07eea46970759aba106f3db3f4bc24c518ab41de Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期二, 20 二月 2024 14:39:04 +0800
Subject: [PATCH] 库中新增更新单条缓存
---
cache/db.go | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/cache/db.go b/cache/db.go
index f283c4b..c07cd80 100644
--- a/cache/db.go
+++ b/cache/db.go
@@ -126,3 +126,21 @@
}
return
}
+
+func (dbp *DbPersons) GetPersonsCompareCacheById(id string) (info *protomsg.Esinfo, err error) {
+ sql := "select id,faceFeature,tableId,enable from dbtablepersons where id = \"" + id + "\""
+ var p DbPersons
+ err = db.Raw(sql).First(&p).Error
+ if err != nil {
+ return nil, err
+ }
+ if p.FaceFeature != "" {
+ info = &protomsg.Esinfo{
+ Id: p.Id,
+ Tableid: p.TableId,
+ FaceFeature: p.FaceFeature,
+ Enable: int32(p.Enable),
+ }
+ }
+ return
+}
--
Gitblit v1.8.0