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