@@ -33,3 +33,32 @@ func GetBasic(c *gin.Context) { | |||||
func SetBasic(c *gin.Context) { | func SetBasic(c *gin.Context) { | ||||
advertising.SetBasic(c) | 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) | |||||
} |
@@ -5,6 +5,8 @@ type PlayletBaseData struct { | |||||
Total string `json:"total" example:"可领取总次数"` | Total string `json:"total" example:"可领取总次数"` | ||||
FirstCount string `json:"first_count" example:"首次可观看集数"` | FirstCount string `json:"first_count" example:"首次可观看集数"` | ||||
SecondCount string `json:"second_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 { | type VideoBaseData struct { | ||||
@@ -13,3 +15,9 @@ type VideoBaseData struct { | |||||
Timer string `json:"timer" example:"观看X秒奖励"` | Timer string `json:"timer" example:"观看X秒奖励"` | ||||
Interval string `json:"interval" example:"领取间隔 秒"` | 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激励视频秘钥"` | |||||
} |
@@ -130,6 +130,8 @@ func rHomePage(r *gin.RouterGroup) { | |||||
func rAdvertising(r *gin.RouterGroup) { | func rAdvertising(r *gin.RouterGroup) { | ||||
r.GET("/getBasic", advertising.GetBasic) | r.GET("/getBasic", advertising.GetBasic) | ||||
r.POST("/setBasic", advertising.SetBasic) | r.POST("/setBasic", advertising.SetBasic) | ||||
r.GET("/getPlayletBasic", advertising.GetPlayletBasic) | |||||
r.POST("/setPlayletBasic", advertising.SetPlayletBasic) | |||||
r.POST("/list", advertising.List) | r.POST("/list", advertising.List) | ||||
r.POST("/save", advertising.Save) | r.POST("/save", advertising.Save) | ||||
r.POST("/del", advertising.Del) | r.POST("/del", advertising.Del) | ||||
@@ -6,9 +6,11 @@ import ( | |||||
"applet/app/md" | "applet/app/md" | ||||
"applet/app/svc" | "applet/app/svc" | ||||
"applet/app/utils" | "applet/app/utils" | ||||
"applet/app/utils/cache" | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" | "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | ||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
"github.com/tidwall/gjson" | |||||
) | ) | ||||
func GetBasic(c *gin.Context) { | func GetBasic(c *gin.Context) { | ||||
@@ -54,3 +56,31 @@ func SetBasic(c *gin.Context) { | |||||
e.OutSuc(c, "success", nil) | e.OutSuc(c, "success", nil) | ||||
return | 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 | |||||
} |
@@ -25,8 +25,6 @@ func FunctionList(c *gin.Context) { | |||||
{"name": "提现(激励视频)", "value": "incentive_withdraw"}, | {"name": "提现(激励视频)", "value": "incentive_withdraw"}, | ||||
{"name": "积分兑换(插屏)", "value": "interstitial_integralExchange"}, | {"name": "积分兑换(插屏)", "value": "interstitial_integralExchange"}, | ||||
{"name": "动态IM(信息流)", "value": "information_im"}, | {"name": "动态IM(信息流)", "value": "information_im"}, | ||||
{"name": "短视频(短视频)", "value": "short_video"}, | |||||
{"name": "短剧(短剧)", "value": "short_playlet"}, | |||||
} | } | ||||
NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(db.Db) | NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(db.Db) | ||||
adv, _, _ := NewAdvertisingSpaceDb.FindUserFeedbackCateAndTotal("1", "1000", "", "") | adv, _, _ := NewAdvertisingSpaceDb.FindUserFeedbackCateAndTotal("1", "1000", "", "") | ||||
@@ -24,8 +24,6 @@ func List(c *gin.Context) { | |||||
{"name": "激励视频", "value": "3"}, | {"name": "激励视频", "value": "3"}, | ||||
{"name": "信息流广告", "value": "4"}, | {"name": "信息流广告", "value": "4"}, | ||||
{"name": "全屏视频", "value": "5"}, | {"name": "全屏视频", "value": "5"}, | ||||
{"name": "短视频", "value": "6"}, | |||||
{"name": "短剧", "value": "7"}, | |||||
} | } | ||||
resp.SelectData = md.AdvertisingPlatform | resp.SelectData = md.AdvertisingPlatform | ||||
NewJpushNoticeDb := implement.NewAdvertisingSpaceDb(db.Db) | NewJpushNoticeDb := implement.NewAdvertisingSpaceDb(db.Db) | ||||
@@ -15,10 +15,16 @@ import ( | |||||
func PlayletBase(c *gin.Context) { | func PlayletBase(c *gin.Context) { | ||||
playletBase := svc.GetSysCfgStr("playlet_base") | playletBase := svc.GetSysCfgStr("playlet_base") | ||||
var res = md.PlayletBaseData{ | 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) | e.OutSuc(c, res, nil) | ||||
return | return | ||||