蛋蛋星球 后台端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

svc_version_info.go 1.5 KiB

3 weeks ago
6 days ago
3 weeks ago
2 weeks ago
5 days ago
3 weeks ago
2 weeks ago
3 weeks ago
6 days ago
3 weeks ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package cloud_bundle
  2. import (
  3. "applet/app/db"
  4. "applet/app/e"
  5. "applet/app/md"
  6. "applet/app/svc"
  7. "applet/app/svc/sys_cfg"
  8. "applet/app/utils"
  9. "encoding/json"
  10. "github.com/gin-gonic/gin"
  11. )
  12. func VersionBase(c *gin.Context) {
  13. appCloudBundleData := svc.GetSysCfgStr("app_version")
  14. tmp := make([]md.CloudBundleVersion, 0)
  15. json.Unmarshal([]byte(appCloudBundleData), &tmp)
  16. data := []md.CloudBundleVersion{
  17. {Type: "station", Name: "官方渠道"},
  18. {Type: "yingyongbao", Name: "应用宝商店"},
  19. {Type: "ios", Name: "IOS商店"},
  20. {Type: "huawei", Name: "华为应用商店"},
  21. {Type: "xiaomi", Name: "小米应用商店"},
  22. {Type: "meizu", Name: "魅族应用商店"},
  23. {Type: "vivo", Name: "VIVO应用商店"},
  24. {Type: "oppo", Name: "OPPO应用商店"},
  25. {Type: "360", Name: "360应用商店"},
  26. }
  27. for k, v := range data {
  28. data[k].Img = "default_icon/" + v.Type + "_icon.png"
  29. data[k].ImgUrl = svc.GetOssUrl(data[k].Img)
  30. for _, v1 := range tmp {
  31. if v1.Type == v.Type {
  32. data[k].Version = v1.Version
  33. data[k].Url = v1.Url
  34. data[k].Content = v1.Content
  35. data[k].IsMust = v1.IsMust
  36. }
  37. }
  38. }
  39. res := md.CloudBundleVersionResp{Version: data}
  40. e.OutSuc(c, res, nil)
  41. return
  42. }
  43. func VersionBaseSave(c *gin.Context) {
  44. var req []md.CloudBundleVersion
  45. if err := c.ShouldBindJSON(&req); err != nil {
  46. e.OutErr(c, e.ERR_INVALID_ARGS, err)
  47. return
  48. }
  49. cfgDb := sys_cfg.NewSysCfgDb(db.Db)
  50. cfgDb.SysCfgUpdate("app_version", utils.SerializeStr(req))
  51. e.OutSuc(c, "success", nil)
  52. return
  53. }