From 74e0391d0f06e76462959df86180a08e6e2359ca Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 17 Dec 2024 10:33:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/hdl/hdl_config.go | 25 +++++++++++++++++++++++++ app/router/router.go | 8 +++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/hdl/hdl_config.go b/app/hdl/hdl_config.go index 4a9194f..a77b173 100644 --- a/app/hdl/hdl_config.go +++ b/app/hdl/hdl_config.go @@ -91,6 +91,31 @@ func Version(c *gin.Context) { e.OutSuc(c, res, nil) return } +func DownloadList(c *gin.Context) { + appVersion := svc.GetSysCfgStr("app_version") + version := make([]md.Version, 0) + json.Unmarshal([]byte(appVersion), &version) + newVersion := make([]md.Version, 0) + for _, v := range version { + if v.Url == "" { + continue + } + v.Img = svc.GetOssUrl("default_icon/" + v.Type + "_icon.png") + newVersion = append(newVersion, v) + } + res := md.VersionResp{Version: newVersion, IsAuditVersion: "0"} + NewCloudBundleDb := implement.NewCloudBundleDb(db.Db) + os := "1" + if c.GetHeader("platform") == "iOS" { + os = "2" + } + data, _ := NewCloudBundleDb.GetCloudBundleVersion(os, c.GetHeader("appversionname")) + if data != nil { + res.IsAuditVersion = utils.IntToStr(data.IsAuditing) + } + e.OutSuc(c, res, nil) + return +} // Start // @Summary 打开app调用 diff --git a/app/router/router.go b/app/router/router.go index c4be1e3..ed99187 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -64,9 +64,11 @@ func route(r *gin.RouterGroup) { r.Use(mw.Limiter) //进行限流 r.Use(mw.CheckSign) r.Any("/testCreateSign", hdl.TestCreateSign) - r.GET("/openApp/start", hdl.Start) //打开app调用 - r.GET("/config", hdl.Config) //基本配置 - r.GET("/version", hdl.Version) //版本数据 + r.GET("/openApp/start", hdl.Start) //打开app调用 + r.GET("/config", hdl.Config) //基本配置 + r.GET("/version", hdl.Version) //版本数据 + r.GET("/downloadList", hdl.DownloadList) //版本数据 + { r.GET("/advertising", hdl.Advertising) //广告位 r.POST("/advertising/detail", hdl.AdvertisingDetail) //广告位