|
- package cloud_bundle
-
- import (
- "applet/app/db"
- "applet/app/e"
- "applet/app/md"
- "applet/app/svc"
- "applet/app/utils"
- "applet/app/utils/cache"
- "applet/app/utils/logx"
- "code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
- "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
- "encoding/json"
- "github.com/gin-gonic/gin"
- )
-
- func ImgBase(c *gin.Context) {
- appCloudBundleData := svc.GetSysCfgStr("app_cloud_bundle_data")
- res := md.CloudBundleImgResp{}
- json.Unmarshal([]byte(appCloudBundleData), &res)
- e.OutSuc(c, res, nil)
- return
- }
- func ImgBaseSave(c *gin.Context) {
- var req md.CloudBundleImgResp
- if err := c.ShouldBindJSON(&req); err != nil {
- e.OutErr(c, e.ERR_INVALID_ARGS, err)
- return
- }
- conn := cache.GetPool().Get()
- cfgDb := implement.NewSysCfgDb(db.Db, conn)
- defer func(cfgDb dao.SysCfgDao) {
- err := cfgDb.Close()
- if err != nil {
- logx.Error("redis close err:" + err.Error()) // 记录错误信息
- }
- }(cfgDb)
-
- cfgDb.SysCfgUpdate("app_cloud_bundle_data", utils.SerializeStr(req))
- e.OutSuc(c, "success", nil)
- return
- }
|