蛋蛋星球 后台端
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_img_base.go 812 B

2 weeks ago
123456789101112131415161718192021222324252627282930313233
  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. "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
  10. "encoding/json"
  11. "github.com/gin-gonic/gin"
  12. )
  13. func ImgBase(c *gin.Context) {
  14. appCloudBundleData := svc.GetSysCfgStr("app_cloud_bundle_data")
  15. res := md.CloudBundleImgResp{}
  16. json.Unmarshal([]byte(appCloudBundleData), &res)
  17. e.OutSuc(c, res, nil)
  18. return
  19. }
  20. func ImgBaseSave(c *gin.Context) {
  21. var req md.CloudBundleImgResp
  22. if err := c.ShouldBindJSON(&req); err != nil {
  23. e.OutErr(c, e.ERR_INVALID_ARGS, err)
  24. return
  25. }
  26. conn := cache.GetPool().Get()
  27. cfgDb := implement.NewSysCfgDb(db.Db, conn)
  28. cfgDb.SysCfgUpdate("app_cloud_bundle_data", utils.SerializeStr(req))
  29. e.OutSuc(c, "success", nil)
  30. return
  31. }