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

2 weeks ago
2 weeks ago
2 weeks ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  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. DayOneCount: gjson.Get(playletBase, "day_one_count").String(),
  20. }
  21. e.OutSuc(c, res, nil)
  22. return
  23. }
  24. func PlayletBaseSave(c *gin.Context) {
  25. var req md.PlayletBaseData
  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. sysCfgDb := sys_cfg.NewSysCfgDb(db.Db)
  34. sysCfgDb.SysCfgUpdate("playlet_base", utils.SerializeStr(req))
  35. e.OutSuc(c, "success", nil)
  36. return
  37. }