@@ -0,0 +1,35 @@ | |||
package content_reward | |||
import ( | |||
"applet/app/svc/content_reward" | |||
"github.com/gin-gonic/gin" | |||
) | |||
// PlayletBase | |||
// @Summary 制度中心-内容奖励-短剧基本信息 | |||
// @Tags 蛋蛋能量 | |||
// @Description 制度中心-内容奖励-短剧基本信息 | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Success 200 {object} md.PlayletBaseData "具体数据" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/institutionalManagement/contentReward/playlet/base [get] | |||
func PlayletBase(c *gin.Context) { | |||
content_reward.PlayletBase(c) | |||
} | |||
// PlayletBaseSave | |||
// @Summary 制度中心-内容奖励-短剧基本配置保存 | |||
// @Tags 蛋蛋能量 | |||
// @Description 制度中心-内容奖励-短剧基本配置保存 | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Param req body md.PlayletBaseData true "(分页信息必填)" | |||
// @Success 200 {string} "具体数据" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/institutionalManagement/contentReward/playlet/save [post] | |||
func PlayletBaseSave(c *gin.Context) { | |||
content_reward.PlayletBaseSave(c) | |||
} |
@@ -0,0 +1,35 @@ | |||
package content_reward | |||
import ( | |||
"applet/app/svc/content_reward" | |||
"github.com/gin-gonic/gin" | |||
) | |||
// VideoBase | |||
// @Summary 制度中心-内容奖励-短视频基本信息 | |||
// @Tags 蛋蛋能量 | |||
// @Description 制度中心-内容奖励-短视频基本信息 | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Success 200 {object} md.VideoBaseData "具体数据" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/institutionalManagement/contentReward/video/base [get] | |||
func VideoBase(c *gin.Context) { | |||
content_reward.VideoBase(c) | |||
} | |||
// VideoBaseSave | |||
// @Summary 制度中心-内容奖励-短视频基本配置保存 | |||
// @Tags 蛋蛋能量 | |||
// @Description 制度中心-内容奖励-短视频基本配置保存 | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Param req body md.VideoBaseData true "(分页信息必填)" | |||
// @Success 200 {string} "具体数据" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/institutionalManagement/contentReward/video/save [post] | |||
func VideoBaseSave(c *gin.Context) { | |||
content_reward.VideoBaseSave(c) | |||
} |
@@ -0,0 +1,15 @@ | |||
package md | |||
type PlayletBaseData struct { | |||
Reward string `json:"reward" example:"单次奖励"` | |||
Total string `json:"total" example:"可领取总次数"` | |||
FirstCount string `json:"first_count" example:"首次可观看集数"` | |||
SecondCount string `json:"second_count" example:"看一次广告解锁集数"` | |||
} | |||
type VideoBaseData struct { | |||
Reward string `json:"reward" example:"单次奖励"` | |||
Total string `json:"total" example:"可领取总次数"` | |||
Timer string `json:"timer" example:"观看X秒奖励"` | |||
Interval string `json:"interval" example:"领取间隔 秒"` | |||
} |
@@ -7,6 +7,7 @@ import ( | |||
"applet/app/hdl/article" | |||
"applet/app/hdl/cloud_bundle" | |||
"applet/app/hdl/comm" | |||
"applet/app/hdl/content_reward" | |||
"applet/app/hdl/financial_center" | |||
"applet/app/hdl/friend_circle" | |||
"applet/app/hdl/im" | |||
@@ -268,6 +269,20 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理 | |||
rModuleSetting.POST("/getArticle", article.List) | |||
rModuleSetting.POST("/updateModuleSetting", module_setting.ModuleSettingUpdate) | |||
} | |||
rContentReward := r.Group("/contentReward") // 内容奖励 | |||
{ | |||
rVideo := rContentReward.Group("/video") | |||
{ | |||
rVideo.GET("/base", content_reward.VideoBase) // | |||
rVideo.POST("/save", content_reward.VideoBaseSave) // | |||
} | |||
rPlaylet := rContentReward.Group("/playlet") | |||
{ | |||
rPlaylet.GET("/base", content_reward.PlayletBase) // | |||
rPlaylet.POST("/save", content_reward.PlayletBaseSave) // | |||
} | |||
} | |||
} | |||
func rMarketingApplications(r *gin.RouterGroup) { //营销应用 | |||
@@ -0,0 +1,41 @@ | |||
package content_reward | |||
import ( | |||
"applet/app/db" | |||
"applet/app/e" | |||
"applet/app/md" | |||
"applet/app/svc" | |||
"applet/app/utils" | |||
"applet/app/utils/cache" | |||
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" | |||
"github.com/gin-gonic/gin" | |||
"github.com/tidwall/gjson" | |||
) | |||
func PlayletBase(c *gin.Context) { | |||
playletBase := svc.GetSysCfgStr("playlet_base") | |||
var res = md.PlayletBaseData{ | |||
Reward: gjson.Get(playletBase, "reward").String(), | |||
Total: gjson.Get(playletBase, "total").String(), | |||
FirstCount: gjson.Get(playletBase, "first_count").String(), | |||
SecondCount: gjson.Get(playletBase, "second_count").String(), | |||
} | |||
e.OutSuc(c, res, nil) | |||
return | |||
} | |||
func PlayletBaseSave(c *gin.Context) { | |||
var req md.PlayletBaseData | |||
err := c.ShouldBindJSON(&req) | |||
if err != nil { | |||
err = svc.HandleValidateErr(err) | |||
err1 := err.(e.E) | |||
e.OutErr(c, err1.Code, err1.Error()) | |||
return | |||
} | |||
redisConn := cache.GetPool().Get() | |||
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) | |||
sysCfgDb.SysCfgUpdate("playlet_base", utils.SerializeStr(req)) | |||
e.OutSuc(c, "success", nil) | |||
return | |||
} |
@@ -0,0 +1,41 @@ | |||
package content_reward | |||
import ( | |||
"applet/app/db" | |||
"applet/app/e" | |||
"applet/app/md" | |||
"applet/app/svc" | |||
"applet/app/utils" | |||
"applet/app/utils/cache" | |||
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" | |||
"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 | |||
} | |||
redisConn := cache.GetPool().Get() | |||
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn) | |||
sysCfgDb.SysCfgUpdate("video_base", utils.SerializeStr(req)) | |||
e.OutSuc(c, "success", nil) | |||
return | |||
} |