package content_reward import ( "applet/app/db" "applet/app/e" "applet/app/md" "applet/app/svc" "applet/app/utils" "applet/app/utils/cache" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "github.com/gin-gonic/gin" "github.com/tidwall/gjson" ) func PlayletBase(c *gin.Context) { playletBase := svc.GetSysCfgStr("playlet_base") var res = md.PlayletBaseData{ Reward: gjson.Get(playletBase, "reward").String(), Total: gjson.Get(playletBase, "total").String(), FirstCount: gjson.Get(playletBase, "first_count").String(), SecondCount: gjson.Get(playletBase, "second_count").String(), } e.OutSuc(c, res, nil) return } func PlayletBaseSave(c *gin.Context) { var req md.PlayletBaseData err := c.ShouldBindJSON(&req) if err != nil { err = svc.HandleValidateErr(err) err1 := err.(e.E) e.OutErr(c, err1.Code, err1.Error()) return } redisConn := cache.GetPool().Get() sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) sysCfgDb.SysCfgUpdate("playlet_base", utils.SerializeStr(req)) e.OutSuc(c, "success", nil) return }