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

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