From 8aa296b660354adf440a005dcbc3883515ed71e2 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期一, 15 四月 2024 11:45:48 +0800
Subject: [PATCH] 修改新的上报协议

---
 controller/systemCtl.go |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/controller/systemCtl.go b/controller/systemCtl.go
index e0ec71b..8904214 100644
--- a/controller/systemCtl.go
+++ b/controller/systemCtl.go
@@ -3,7 +3,9 @@
 import (
 	"gat1400Exchange/models"
 	"gat1400Exchange/pkg/logger"
+	"gat1400Exchange/service"
 	"net/http"
+	"strconv"
 	"time"
 
 	"gat1400Exchange/config"
@@ -62,6 +64,7 @@
 		return
 	}
 
+	// 涓婃姤璁惧淇℃伅
 	var d = models.Device{
 		Id: req.KeepaliveObject.DeviceID,
 	}
@@ -70,6 +73,8 @@
 	if err != nil {
 		logger.Warn("Device db update camera error:%s", err.Error())
 	}
+
+	service.KeepDeviceAlive(req.KeepaliveObject.DeviceID)
 
 	rspMsg := vo.ResponseStatus{
 		RequestURL:   c.FullPath(),
@@ -105,9 +110,10 @@
 
 // 鏃堕棿鏍″噯
 func (s SystemController) Time(c *gin.Context) {
+	iTime, _ := strconv.ParseInt(time.Now().Format("20060102150405"), 10, 64)
 	rspMsg := vo.ResponseSystemTime{
 		VIIDServerID: config.ServeConf.ID,
-		LocalTime:    time.Now().Format("20060102150405"),
+		LocalTime:    iTime,
 	}
 
 	c.JSON(http.StatusOK, gin.H{"SystemTimeObject": rspMsg})

--
Gitblit v1.8.0