|
- package content_reward
-
- import (
- "applet/app/db"
- "applet/app/e"
- "applet/app/md"
- "applet/app/svc"
- "applet/app/svc/sys_cfg"
- "applet/app/utils"
- "github.com/gin-gonic/gin"
- "github.com/tidwall/gjson"
- )
-
- func VideoBase(c *gin.Context) {
- videoBase := svc.GetSysCfgStr("video_base")
- var res = md.VideoBaseData{
- Reward: gjson.Get(videoBase, "reward").String(),
- Total: gjson.Get(videoBase, "total").String(),
- Timer: gjson.Get(videoBase, "timer").String(),
- Interval: gjson.Get(videoBase, "interval").String(),
- }
- e.OutSuc(c, res, nil)
- return
- }
-
- func VideoBaseSave(c *gin.Context) {
- var req md.VideoBaseData
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = svc.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- sysCfgDb := sys_cfg.NewSysCfgDb(db.Db)
- sysCfgDb.SysCfgUpdate("video_base", utils.SerializeStr(req))
- e.OutSuc(c, "success", nil)
- return
- }
|