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

42 lines
1.0 KiB

  1. package content_reward
  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. "github.com/gin-gonic/gin"
  11. "github.com/tidwall/gjson"
  12. )
  13. func VideoBase(c *gin.Context) {
  14. videoBase := svc.GetSysCfgStr("video_base")
  15. var res = md.VideoBaseData{
  16. Reward: gjson.Get(videoBase, "reward").String(),
  17. Total: gjson.Get(videoBase, "total").String(),
  18. Timer: gjson.Get(videoBase, "timer").String(),
  19. Interval: gjson.Get(videoBase, "interval").String(),
  20. }
  21. e.OutSuc(c, res, nil)
  22. return
  23. }
  24. func VideoBaseSave(c *gin.Context) {
  25. var req md.VideoBaseData
  26. err := c.ShouldBindJSON(&req)
  27. if err != nil {
  28. err = svc.HandleValidateErr(err)
  29. err1 := err.(e.E)
  30. e.OutErr(c, err1.Code, err1.Error())
  31. return
  32. }
  33. redisConn := cache.GetPool().Get()
  34. sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
  35. sysCfgDb.SysCfgUpdate("video_base", utils.SerializeStr(req))
  36. e.OutSuc(c, "success", nil)
  37. return
  38. }