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

1 week ago
1 week ago
12345678910111213141516171819202122232425262728293031323334353637383940
  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 PlayletBase(c *gin.Context) {
  13. playletBase := svc.GetSysCfgStr("playlet_base")
  14. var res = md.PlayletBaseData{
  15. Reward: gjson.Get(playletBase, "reward").String(),
  16. Total: gjson.Get(playletBase, "total").String(),
  17. FirstCount: gjson.Get(playletBase, "first_count").String(),
  18. SecondCount: gjson.Get(playletBase, "second_count").String(),
  19. }
  20. e.OutSuc(c, res, nil)
  21. return
  22. }
  23. func PlayletBaseSave(c *gin.Context) {
  24. var req md.PlayletBaseData
  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("playlet_base", utils.SerializeStr(req))
  34. e.OutSuc(c, "success", nil)
  35. return
  36. }