From 869149fa13676aaaf20cf2c62c1c69d61bec9c77 Mon Sep 17 00:00:00 2001 From: aarongao Date: Mon, 13 Apr 2020 18:38:40 +0800 Subject: [PATCH] .. --- API/SystemInfo.go | 12 +++++------- Config/config.go | 2 -- Config/config.json | 4 +--- README.md | 4 ++-- main_1.1 | Bin 0 -> 26607826 bytes 5 files changed, 8 insertions(+), 14 deletions(-) create mode 100755 main_1.1 diff --git a/API/SystemInfo.go b/API/SystemInfo.go index c4544bc..a3a6295 100644 --- a/API/SystemInfo.go +++ b/API/SystemInfo.go @@ -3,7 +3,6 @@ package Api import ( "github.com/aarongao/tools" "github.com/gin-gonic/gin" - "letu/Config" "letu/DB" ) @@ -11,7 +10,7 @@ import ( // @Description 查询系统信息接口 // @Accept json // @Produce json -// @Success 200 {object} tools.ResponseSeccess "Version=最新版本号UpdateLocationInterval上报位置时间间隔(秒)" +// @Success 200 {object} tools.ResponseSeccess "ApiVersion=最新的api版本号SupportVersion=支持最低的app版本号UpdateLocationInterval上报位置时间间隔(秒)" // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" // @Router /SystemInfo? [get] func SystemInfo(c *gin.Context) { @@ -19,12 +18,11 @@ func SystemInfo(c *gin.Context) { c.Header("Access-Control-Allow-Credentials", "true") info := make(map[string]interface{}) - info["ApiVersion"] = Config.Info.ApiVersion + ApiVersion := DB.Redis.Get("ApiVersion") + info["ApiVersion"] = ApiVersion - info["SupportVersion"] = Config.Info.SupportVersion - - //SupportVersion := DB.Redis.Get("SupportVersion") - //info["SupportVersion"] = SupportVersion + SupportVersion := DB.Redis.Get("SupportVersion") + info["SupportVersion"] = SupportVersion UpdateLocationInterval := DB.Redis.Get("UpdateLocationInterval") info["UpdateLocationInterval"] = UpdateLocationInterval diff --git a/Config/config.go b/Config/config.go index b2f213a..9e04d0b 100644 --- a/Config/config.go +++ b/Config/config.go @@ -10,8 +10,6 @@ type Config struct { Env string TokenSecret string ServerPort string - ApiVersion string - SupportVersion string } var Info = Config{} diff --git a/Config/config.json b/Config/config.json index 9ffd450..4a1efed 100644 --- a/Config/config.json +++ b/Config/config.json @@ -7,7 +7,5 @@ "redisPath": "127.0.0.1:6379", "Env": "DEV", "tokenSecret": "token.secret", - "ServerPort": ":8080", - "ApiVersion": "1.1", - "SupportVersion": "1.0" + "ServerPort": ":8080" } diff --git a/README.md b/README.md index 3a67bea..b445069 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## 乐游图后端接口文档 | Specification | Value | |-----|-----| -| API Version | 1.0.0 | +| API Version | 1.1.0 | | BasePath | 正式 leyoutu.st-i.com.cn; 测试 leyoutu.sti-uat.com | @@ -880,7 +880,7 @@ | Code | Type | Model | Message | |-----|-----|-----|-----| -| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Version=最新版本号UpdateLocationInterval上报位置时间间隔(秒) | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | ApiVersion=最新的api版本号SupportVersion=支持最低的app版本号UpdateLocationInterval上报位置时间间隔(秒) | | 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | diff --git a/main_1.1 b/main_1.1 new file mode 100755 index 0000000..fb80714 Binary files /dev/null and b/main_1.1 differ -- libgit2 0.21.0