huangjiajun před 5 dny
rodič
revize
c2bd664132
7 změnil soubory, kde provedl 79 přidání a 8 odebrání
  1. +29
    -0
      app/hdl/advertising/hdl_base.go
  2. +8
    -0
      app/md/md_content_reward.go
  3. +2
    -0
      app/router/router.go
  4. +30
    -0
      app/svc/advertising/svc_base.go
  5. +0
    -2
      app/svc/advertising/svc_function.go
  6. +0
    -2
      app/svc/advertising/svc_list.go
  7. +10
    -4
      app/svc/content_reward/svc_playlet.go

+ 29
- 0
app/hdl/advertising/hdl_base.go Zobrazit soubor

@@ -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)
}

+ 8
- 0
app/md/md_content_reward.go Zobrazit soubor

@@ -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激励视频秘钥"`
}

+ 2
- 0
app/router/router.go Zobrazit soubor

@@ -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)


+ 30
- 0
app/svc/advertising/svc_base.go Zobrazit soubor

@@ -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
}

+ 0
- 2
app/svc/advertising/svc_function.go Zobrazit soubor

@@ -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", "", "")


+ 0
- 2
app/svc/advertising/svc_list.go Zobrazit soubor

@@ -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)


+ 10
- 4
app/svc/content_reward/svc_playlet.go Zobrazit soubor

@@ -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


Načítá se…
Zrušit
Uložit