liuxiaolong
2019-10-31 718bcd41127a8c5c93a20ca6dfce6e5c5fcbc4e1
controllers/syssetcont.go
@@ -51,6 +51,7 @@
   NewTime   string `json:"newTime" example:"手动指定时间"`
}
// @Security ApiKeyAuth
// @Summary 存储信息查询
// @Description 存储信息查询
// @Accept  json
@@ -69,6 +70,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 存储信息修改
// @Description 存储信息修改
// @Accept  json
@@ -95,6 +97,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 存储信息修改
// @Description 存储信息修改
// @Accept  json
@@ -117,6 +120,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 视频截取时长修改
// @Description 视频截取时长信息
// @Accept  x-www-form-urlencoded
@@ -142,6 +146,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 获取分析设备信息
// @Description  分析设备信息
// @Accept  json
@@ -179,6 +184,7 @@
   }
}
// @Security ApiKeyAuth
// saveDevInfo  dev_id dev_name
// @Summary 保存视频分析设备信息
// @Description 分析设备信息
@@ -211,6 +217,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary GB28181设置查询
// @Description GB28181设置信息查询
// @Accept  json
@@ -229,6 +236,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary GB28181设置信息修改
// @Description GB28181设置修改
// @Accept  json
@@ -255,6 +263,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 获取时间配置
// @Description  系统时间配置信息
// @Accept  json
@@ -271,6 +280,7 @@
   util.ResponseFormat(c, code.Success, resData)
}
// @Security ApiKeyAuth
// @Summary 测试同步时间
// @Description 测试同步时间服务器是否可用
// @Accept  json
@@ -301,6 +311,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 设置系统时间
// @Description 校正系统时间
// @Accept  json
@@ -315,11 +326,6 @@
   err := c.BindJSON(&args)
   if err != nil {
      util.ResponseFormat(c, code.RequestParamError, "参数有误")
      return
   }
   if root := sys.CheckRootPermissions(); !root {
      util.ResponseFormat(c, code.ServiceInsideError, "服务器没有修改时间的权限")
      return
   }
@@ -345,6 +351,7 @@
   util.ResponseFormat(c, code.UpdateSuccess, "配置成功")
}
// @Security ApiKeyAuth
// @Summary 查询系统运行信息
// @Description 获取当前系统的运行状态,CPU, GPU, 内存等
// @Produce json
@@ -357,6 +364,7 @@
   util.ResponseFormat(c, code.UpdateSuccess, info)
}
// @Security ApiKeyAuth
// @Summary 查询系统状态阈值设置
// @Description 获取当前系统的运行状态,CPU, GPU, 内存的阈值配置
// @Produce json
@@ -367,3 +375,20 @@
func (sset SysSetController) GetSysThresholds(c *gin.Context) {
   util.ResponseFormat(c, code.UpdateSuccess, config.Server.SysThresholds)
}
// @Security ApiKeyAuth
// @Summary 重启系统
// @Description 重启操作系统
// @Produce json
// @Tags sysset
// @Success 200 {string} json "{"code":200, msg:"目录结构数据", success:true}"
// @Failure 500 {string} json "{"code":500,  msg:"返回错误信息", success:false}"
// @Router /data/api-v/sysset/reboot [GET]
func (sset SysSetController) RebootOS(c *gin.Context) {
   if isOk, msg := sys.Reboot(); !isOk {
      util.ResponseFormat(c, code.UpdateFail, msg)
      return
   }
   util.ResponseFormat(c, code.Success, "正在重启")
}