025a2fc1
aarongao
.
|
1
2
3
4
5
|
package Api
import (
"github.com/aarongao/tools"
"github.com/gin-gonic/gin"
|
025a2fc1
aarongao
.
|
6
7
8
9
10
11
12
|
"letu/Config"
"letu/DB"
)
// @Title 查询系统信息接口
// @Description 查询系统信息接口
// @Accept json
|
869149fa
aarongao
..
|
13
|
// @Produce json
|
025a2fc1
aarongao
.
|
14
15
16
17
18
19
20
|
// @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")
|
869149fa
aarongao
..
|
21
22
|
info := make(map[string]interface{})
info["Version"] = Config.Info.Version
|
483ade81
aarongao
v1.1
|
23
|
info["SupportVersion"] = Config.Info.SupportVersion
|
869149fa
aarongao
..
|
24
25
|
UpdateLocationInterval := DB.Redis.Get("UpdateLocationInterval")
|
483ade81
aarongao
v1.1
|
26
|
info["UpdateLocationInterval"] = UpdateLocationInterval
|
025a2fc1
aarongao
.
|
27
28
29
30
31
32
33
|
c.JSON(200, tools.ResponseSeccess{
0,
info,
})
}
|
483ade81
aarongao
v1.1
|
|
|