SystemInfo.go
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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,
})
}