From 3771d5551480964ab17f4c23a152df2482bf6470 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期六, 18 五月 2024 04:15:22 +0800
Subject: [PATCH] 更新设备操作

---
 repository/captureRepo.go |   66 ---------------------------------
 1 files changed, 0 insertions(+), 66 deletions(-)

diff --git a/repository/captureRepo.go b/repository/captureRepo.go
index 75ca1c5..1c33540 100644
--- a/repository/captureRepo.go
+++ b/repository/captureRepo.go
@@ -11,8 +11,6 @@
 	"gat1400Exchange/pkg/logger"
 	"gat1400Exchange/util"
 	"gat1400Exchange/vo"
-
-	uuid "github.com/satori/go.uuid"
 )
 
 type CaptureRepository struct {
@@ -117,60 +115,6 @@
 	return
 }
 
-func (c CaptureRepository) PackPushData(deviceId, faceId, faceImage, appearTime string) *vo.PushDataInfo {
-	var pd = new(vo.PushDataInfo)
-	var device models.Device
-
-	if err := device.FindById(deviceId); err != nil {
-		logger.Warn("Can't find device in database, device:%s, %s", deviceId, err.Error())
-		return pd
-	}
-
-	// 鍖归厤妤煎眰
-	faceAppearTime, err := time.ParseInLocation("20060102150405", appearTime, time.Local)
-	if err != nil {
-		logger.Warn("Parse face appear time error, %s", err.Error())
-		faceAppearTime = time.Now()
-	}
-
-	// 鐢垫鍋滄鐨勬椂闂�
-	devStopTime := time.Now().Format("2006-01-02 15:04:05")
-	var devPos models.Positions
-	_ = devPos.FindDevicePosition(deviceId, faceAppearTime.Unix()+5) // 鍔�5绉掔數姊叧闂ㄧ殑鏃堕棿
-	if devPos.TimeString != "" {
-		devStopTime = devPos.TimeString
-	}
-
-	imageBytes, err := base64.StdEncoding.DecodeString(faceImage)
-	if err != nil {
-		logger.Warn("Decode Image Base64 String failure, %s", err.Error())
-		return pd
-	}
-
-	pd.PicMaxImages = append(pd.PicMaxImages, imageBytes)
-
-	tr := vo.TaskResultInfo{
-		Id:            uuid.NewV4().String(),
-		CameraId:      deviceId,
-		CameraAddr:    device.Addr + devPos.Pos,
-		CameraName:    device.Name,
-		PicMaxUrl:     []string{""},
-		PicDate:       faceAppearTime.Format("2006-01-02 15:04:05"),
-		LikeDate:      devStopTime,
-		AnalyServerId: deviceId,
-		DataSource:    "camera",
-		TargetInfo:    []vo.TargetInfo{{TargetId: faceId}},
-	}
-
-	pd.SourceData = vo.ESInfo{
-		TaskResultInfo: tr,
-		Version:        "3.3",
-		UpdateTime:     time.Now().Format("2006-01-02 15:04:05"),
-	}
-
-	return pd
-}
-
 func (c CaptureRepository) PackPushDataV2(deviceId, faceId, appearTime string, bgImgBytes, faceImgBytes []byte) *vo.PushDataInfoV2 {
 	var pd = new(vo.PushDataInfoV2)
 	var floor string
@@ -182,19 +126,9 @@
 	}
 
 	if config.ServeConf.Role == "server" {
-		var device models.Device
-
-		if err := device.FindById(deviceId); err != nil {
-			logger.Warn("Can't find device in database, device:%s, %s", deviceId, err.Error())
-			return pd
-		}
-
 		// 鍖归厤妤煎眰
 		var devPos models.Positions
 		_ = devPos.FindDevicePosition(deviceId, faceAppearTime.Unix()+5) // 鍔�5绉掔數姊叧闂ㄧ殑鏃堕棿
-		if devPos.Pos == "" {
-			devPos.Pos = device.Floor
-		}
 
 		floor = devPos.Pos
 	}

--
Gitblit v1.8.0