SystemInfo.go 1.01 KB
package Api

import (
	"github.com/aarongao/tools"
	"github.com/gin-gonic/gin"
	"letu/Config"
	"letu/DB"
)

// @Title 查询系统信息接口
// @Description 查询系统信息接口
// @Accept  json
// @Produce  json
// @Success 200 {object} tools.ResponseSeccess "Version=最新版本号UpdateLocationInterval上报位置时间间隔(秒)"
// @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}"
// @Router /SystemInfo? [get]
func SystemInfo(c *gin.Context) {
	c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin"))
	c.Header("Access-Control-Allow-Credentials", "true")

	info := make(map[string]interface{})
	info["ApiVersion"] = Config.Info.ApiVersion

	info["SupportVersion"] = Config.Info.SupportVersion

	//SupportVersion := DB.Redis.Get("SupportVersion")
	//info["SupportVersion"] = SupportVersion

	UpdateLocationInterval := DB.Redis.Get("UpdateLocationInterval")
	info["UpdateLocationInterval"] = UpdateLocationInterval

	c.JSON(200, tools.ResponseSeccess{
		0,
		info,
	})

}