Bläddra i källkod

update

master
dengbiao 2 veckor sedan
förälder
incheckning
be7fe8c754
5 ändrade filer med 35 tillägg och 8 borttagningar
  1. +1
    -1
      go.mod
  2. +1
    -0
      go.sum
  3. +1
    -1
      rule/egg_energy/activity_coin_ready_exchange_egg_energy.go
  4. +31
    -5
      rule/egg_energy/give_activty_coin.go
  5. +1
    -1
      rule/egg_energy/home_page_watch_over_ad.go

+ 1
- 1
go.mod Visa fil

@@ -3,7 +3,7 @@ module code.fnuoos.com/EggPlanet/egg_system_rules.git
go 1.19

// go.mod文件中
//replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models
replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models

require (
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5


+ 1
- 0
go.sum Visa fil

@@ -2,6 +2,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241128102555-fc839292d728 h1:BHW0yPeka1RRS4pIcZKwiatVg9U4mE8iiTl1+YCk1vQ=
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241128102555-fc839292d728/go.mod h1:+bDK4gfBq4LEkhh6K/A46+0urH/sgxDxnjIjlxb9HI8=
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241204145112-7b4c29691a6d/go.mod h1:+bDK4gfBq4LEkhh6K/A46+0urH/sgxDxnjIjlxb9HI8=
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be h1:zuleX5JnIGQpt6wDAmCFs++lLgOmE6kWo3xkJnjrSck=
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be/go.mod h1:Yuc7XnUQ15eaC0ZobcJG7XwkVTttVqp52OTanXhI1Qk=
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 h1:dqvWJqlJi0WXCwTxbWPLvSOsKPjP+iEDBVgLcAl9nOE=


+ 1
- 1
rule/egg_energy/activity_coin_ready_exchange_egg_energy.go Visa fil

@@ -41,7 +41,7 @@ func ActivityCoinReadyExchangeEggEnergy(engine *xorm.Engine, uid int64, ch *rabb
if err != nil {
return
}
if videoRewardSystem.RewardValue == "" || videoRewardSystem.RewardTotalNum == "" || videoRewardSystem.IntervalMinutes == "" || videoRewardSystem.EachRoundHour == "" {
if videoRewardSystem.RewardTotalNum == "" || videoRewardSystem.IntervalMinutes == "" || videoRewardSystem.EachRoundHour == "" {
err = errors.New("视屏奖励机制设置未完全!")
return
}


+ 31
- 5
rule/egg_energy/give_activty_coin.go Visa fil

@@ -1,6 +1,7 @@
package egg_energy

import (
db "code.fnuoos.com/EggPlanet/egg_models.git/src"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
@@ -47,7 +48,7 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ch *rabbit
if err != nil {
return
}
if videoRewardSystem.RewardValue == "" || videoRewardSystem.RewardTotalNum == "" || videoRewardSystem.IntervalMinutes == "" || videoRewardSystem.EachRoundHour == "" {
if videoRewardSystem.RewardTotalNum == "" || videoRewardSystem.IntervalMinutes == "" || videoRewardSystem.EachRoundHour == "" {
err = errors.New("视屏奖励机制设置未完全!")
return
}
@@ -62,16 +63,33 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ch *rabbit
return
}

rewardValue := egg_system_rules.StrToFloat64(videoRewardSystem.RewardValue) //TODO::奖励多少个活跃积分(根据ecpm, 新用户机制, 蛋蛋分机制)
var rewardValue float64 //TODO::奖励多少个活跃积分(根据ecpm, 新用户机制, 蛋蛋分机制)
redisConn := cache.GetPool().Get()
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
videoRewardUnitPrice := sysCfgDb.SysCfgGetWithDb(enum.VideoRewardUnitPrice)
if videoRewardUnitPrice != "" { //处理ecpm
var coin model.VirtualCoin
_, err = engine.Where("id = ?", eggEnergyBasicSetting.PersonEggPointsCoinId).Get(&coin)
if err != nil {
return err
}
activePointsCoinExchangeRatioValue, _ := decimal.NewFromString(coin.ExchangeRatio)
videoRewardUnitPriceValue, _ := decimal.NewFromString(videoRewardUnitPrice)
rewardValue, _ = videoRewardUnitPriceValue.Mul(activePointsCoinExchangeRatioValue).Float64()
} else {
rewardValue = egg_system_rules.StrToFloat64(videoRewardSystem.RewardValue)
}

var newUserRewardRules *md2.NewUserRewardRules
err = json.Unmarshal([]byte(eggEnergyBasicSetting.NewUserIncentiveRules), &newUserRewardRules)
if err != nil {
return
}
userCreateAt := egg_system_rules.String2Time(user.CreateAt)
if int(now.Sub(userCreateAt).Hours()/24) <= newUserRewardRules.ContinueDays {
if int(now.Sub(userCreateAt).Hours()/24) <= newUserRewardRules.ContinueDays { //处理新用户机制
rewardValue *= newUserRewardRules.RewardCoefficient
}

score := 60.00
esIndex := es.GetLatestEffectiveIndexFromAlias(now)
esIndexName := md.EggEnergyUserEggScoreEsAlias + "_" + esIndex
@@ -89,10 +107,18 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ch *rabbit
}
score = doc.ScoreValue
}
if score > 60 {
//TODO::按照蛋蛋分比重×
eggPointPartitionCoefficientManagementDb := implement.NewEggPointPartitionCoefficientManagementDb(db.Db)
eggPointPartitionCoefficientManagements, err1 := eggPointPartitionCoefficientManagementDb.EggPointPartitionCoefficientManagementGetAll()
if err1 != nil {
return err1
}
for _, v := range *eggPointPartitionCoefficientManagements { //处理蛋蛋分机制
if egg_system_rules.StrToFloat64(v.StartScore) <= score && egg_system_rules.StrToFloat64(v.EndScore) >= score {
rewardValue *= egg_system_rules.StrToFloat64(v.Coefficient)
}
}

//处理圈层奖励
var rewardSystemMap = map[int]*md2.RewardSystemStruct{}
for _, v := range rewardSystem {
rewardSystemMap[v.Level] = v


+ 1
- 1
rule/egg_energy/home_page_watch_over_ad.go Visa fil

@@ -60,7 +60,7 @@ func settlementPublicGiveActivityCoin(engine *xorm.Engine, uid int64, ch *rabbit
if err != nil {
return err
}
if videoRewardSystem.RewardValue == "" || videoRewardSystem.RewardTotalNum == "" || videoRewardSystem.IntervalMinutes == "" || videoRewardSystem.EachRoundHour == "" {
if videoRewardSystem.RewardTotalNum == "" || videoRewardSystem.IntervalMinutes == "" || videoRewardSystem.EachRoundHour == "" {
err = errors.New("视屏奖励机制设置未完全!")
return err
}


Laddar…
Avbryt
Spara