蛋蛋星球 后台端
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.
 
 
 
 

43 lines
1.0 KiB

  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/utils"
  8. "applet/app/utils/cache"
  9. "applet/app/utils/logx"
  10. "code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
  11. "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
  12. "encoding/json"
  13. "github.com/gin-gonic/gin"
  14. )
  15. func ImgBase(c *gin.Context) {
  16. appCloudBundleData := svc.GetSysCfgStr("app_cloud_bundle_data")
  17. res := md.CloudBundleImgResp{}
  18. json.Unmarshal([]byte(appCloudBundleData), &res)
  19. e.OutSuc(c, res, nil)
  20. return
  21. }
  22. func ImgBaseSave(c *gin.Context) {
  23. var req md.CloudBundleImgResp
  24. if err := c.ShouldBindJSON(&req); err != nil {
  25. e.OutErr(c, e.ERR_INVALID_ARGS, err)
  26. return
  27. }
  28. conn := cache.GetPool().Get()
  29. cfgDb := implement.NewSysCfgDb(db.Db, conn)
  30. defer func(cfgDb dao.SysCfgDao) {
  31. err := cfgDb.Close()
  32. if err != nil {
  33. logx.Error("redis close err:" + err.Error()) // 记录错误信息
  34. }
  35. }(cfgDb)
  36. cfgDb.SysCfgUpdate("app_cloud_bundle_data", utils.SerializeStr(req))
  37. e.OutSuc(c, "success", nil)
  38. return
  39. }