| | |
| | | return |
| | | } |
| | | |
| | | if root := sys.CheckRootPermissions(); !root { |
| | | util.ResponseFormat(c, code.ServiceInsideError, "服务器没有修改时间的权限") |
| | | return |
| | | } |
| | | |
| | | if args.TimeZone != "CST" && args.TimeZone != "UTC" { |
| | | if r := sys.SetTimeZone(args.TimeZone); !r { |
| | | util.ResponseFormat(c, code.RequestParamError, "时区参数错误") |
| | |
| | | func (sset SysSetController) GetSysThresholds(c *gin.Context) { |
| | | util.ResponseFormat(c, code.UpdateSuccess, config.Server.SysThresholds) |
| | | } |
| | | |
| | | // @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, "正在重启") |
| | | } |