diff --git a/app/hdl/advertising/hdl_base.go b/app/hdl/advertising/hdl_base.go index 573c8bd..68d2908 100644 --- a/app/hdl/advertising/hdl_base.go +++ b/app/hdl/advertising/hdl_base.go @@ -33,3 +33,32 @@ func GetBasic(c *gin.Context) { func SetBasic(c *gin.Context) { advertising.SetBasic(c) } + +// GetPlayletBasic +// @Summary 广告管理-短剧设置-信息 +// @Tags 广告管理 +// @Description 广告管理-短剧设置-信息 +// @Accept json +// @Produce json +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Success 200 {object} md.AdvertisingBaseResp "具体数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/advertising/getPlayletBasic [get] +func GetPlayletBasic(c *gin.Context) { + advertising.GetPlayletBasic(c) +} + +// SetPlayletBasic +// @Summary 广告管理-短剧设置-信息保存 +// @Tags 广告管理 +// @Description 广告管理-短剧设置-信息保存 +// @Accept json +// @Produce json +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Param req body md.AdvertisingBase true "(分页信息必填)" +// @Success 200 {string} "具体数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/advertising/setPlayletBasic [post] +func SetPlayletBasic(c *gin.Context) { + advertising.SetPlayletBasic(c) +} diff --git a/app/md/md_content_reward.go b/app/md/md_content_reward.go index 623412c..f001ae1 100644 --- a/app/md/md_content_reward.go +++ b/app/md/md_content_reward.go @@ -5,6 +5,8 @@ type PlayletBaseData struct { Total string `json:"total" example:"可领取总次数"` FirstCount string `json:"first_count" example:"首次可观看集数"` SecondCount string `json:"second_count" example:"看一次广告解锁集数"` + DayAllCount string `json:"day_all_count" example:"每天全部短剧解锁次数"` + DayOneCount string `json:"day_one_count" example:"每天每个短剧解锁次数"` } type VideoBaseData struct { @@ -13,3 +15,9 @@ type VideoBaseData struct { Timer string `json:"timer" example:"观看X秒奖励"` Interval string `json:"interval" example:"领取间隔 秒"` } +type PlayletIncentiveBaseData struct { + AndroidAdvId string `json:"android_adv_id" example:"安卓激励视频广告位"` + AndroidAdvSecret string `json:"android_adv_secret" example:"安卓激励视频秘钥"` + IosAdvId string `json:"ios_adv_id" example:"iOS激励视频广告位"` + IosAdvSecret string `json:"ios_adv_secret" example:"iOS激励视频秘钥"` +} diff --git a/app/router/router.go b/app/router/router.go index d878a5f..accebaa 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -130,6 +130,8 @@ func rHomePage(r *gin.RouterGroup) { func rAdvertising(r *gin.RouterGroup) { r.GET("/getBasic", advertising.GetBasic) r.POST("/setBasic", advertising.SetBasic) + r.GET("/getPlayletBasic", advertising.GetPlayletBasic) + r.POST("/setPlayletBasic", advertising.SetPlayletBasic) r.POST("/list", advertising.List) r.POST("/save", advertising.Save) r.POST("/del", advertising.Del) diff --git a/app/svc/advertising/svc_base.go b/app/svc/advertising/svc_base.go index 470ac20..0756e8b 100644 --- a/app/svc/advertising/svc_base.go +++ b/app/svc/advertising/svc_base.go @@ -6,9 +6,11 @@ import ( "applet/app/md" "applet/app/svc" "applet/app/utils" + "applet/app/utils/cache" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "code.fnuoos.com/EggPlanet/egg_models.git/src/model" "github.com/gin-gonic/gin" + "github.com/tidwall/gjson" ) func GetBasic(c *gin.Context) { @@ -54,3 +56,31 @@ func SetBasic(c *gin.Context) { e.OutSuc(c, "success", nil) return } + +func GetPlayletBasic(c *gin.Context) { + playletBase := svc.GetSysCfgStr("playlet_incentive_base") + var res = md.PlayletIncentiveBaseData{ + AndroidAdvId: gjson.Get(playletBase, "android_adv_id").String(), + AndroidAdvSecret: gjson.Get(playletBase, "android_adv_secret").String(), + IosAdvId: gjson.Get(playletBase, "ios_adv_id").String(), + IosAdvSecret: gjson.Get(playletBase, "ios_adv_secret").String(), + } + e.OutSuc(c, res, nil) + return +} + +func SetPlayletBasic(c *gin.Context) { + var req md.PlayletIncentiveBaseData + 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_incentive_base", utils.SerializeStr(req)) + e.OutSuc(c, "success", nil) + return +} diff --git a/app/svc/advertising/svc_function.go b/app/svc/advertising/svc_function.go index 8043e10..5fa12e4 100644 --- a/app/svc/advertising/svc_function.go +++ b/app/svc/advertising/svc_function.go @@ -25,8 +25,6 @@ func FunctionList(c *gin.Context) { {"name": "提现(激励视频)", "value": "incentive_withdraw"}, {"name": "积分兑换(插屏)", "value": "interstitial_integralExchange"}, {"name": "动态IM(信息流)", "value": "information_im"}, - {"name": "短视频(短视频)", "value": "short_video"}, - {"name": "短剧(短剧)", "value": "short_playlet"}, } NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(db.Db) adv, _, _ := NewAdvertisingSpaceDb.FindUserFeedbackCateAndTotal("1", "1000", "", "") diff --git a/app/svc/advertising/svc_list.go b/app/svc/advertising/svc_list.go index 8944a57..c46b6ac 100644 --- a/app/svc/advertising/svc_list.go +++ b/app/svc/advertising/svc_list.go @@ -24,8 +24,6 @@ func List(c *gin.Context) { {"name": "激励视频", "value": "3"}, {"name": "信息流广告", "value": "4"}, {"name": "全屏视频", "value": "5"}, - {"name": "短视频", "value": "6"}, - {"name": "短剧", "value": "7"}, } resp.SelectData = md.AdvertisingPlatform NewJpushNoticeDb := implement.NewAdvertisingSpaceDb(db.Db) diff --git a/app/svc/content_reward/svc_playlet.go b/app/svc/content_reward/svc_playlet.go index cf4a866..e53b4d2 100644 --- a/app/svc/content_reward/svc_playlet.go +++ b/app/svc/content_reward/svc_playlet.go @@ -15,10 +15,16 @@ import ( 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(), + 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(), + DayAllCount: gjson.Get(playletBase, "day_all_count").String(), + DayOneCount: gjson.Get(playletBase, "day_one_count").String(), + AndroidAdvId: gjson.Get(playletBase, "android_adv_id").String(), + AndroidAdvSecret: gjson.Get(playletBase, "android_adv_secret").String(), + IosAdvId: gjson.Get(playletBase, "ios_adv_id").String(), + IosAdvSecret: gjson.Get(playletBase, "ios_adv_secret").String(), } e.OutSuc(c, res, nil) return