zhangzengfei
2024-04-15 8aa296b660354adf440a005dcbc3883515ed71e2
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})