Pārlūkot izejas kodu

feat: add CreateEsScoreAndAssignValuesDoc

master
shenjiachi pirms 1 dienas
vecāks
revīzija
0e1d840a15
2 mainītis faili ar 121 papildinājumiem un 0 dzēšanām
  1. +59
    -0
      rule/egg_energy/create_es_score_and_assign_value.go
  2. +62
    -0
      rule/egg_energy/enum/es_egg_energy_score_enum.go

+ 59
- 0
rule/egg_energy/create_es_score_and_assign_value.go Parādīt failu

@@ -0,0 +1,59 @@
package egg_energy

import (
"code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/enum"
utils "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils"
"code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
"fmt"
)

func CreateEsScoreAndAssignValuesDoc(index, id string, uid int64, kind enum.EggEnergyUserEggScoreEsKind, value string, now string) error {
m := md.EggEnergyUserEggScoreEs{
Uid: uid,
CreatedAt: now,
UpdatedAt: now,
}
switch kind {
case enum.ScoreValue:
m.ScoreValue = utils.StrToFloat64(value)
case enum.ScoreValueKind:
m.ScoreValueKind = int32(utils.StrToInt64(value))
case enum.Ecpm:
m.Ecpm = utils.StrToFloat64(value)
case enum.InviteUserNums:
m.InviteUserNums = utils.StrToInt(value)
case enum.TeamActivityNums:
m.TeamActivityNums = utils.StrToInt(value)
case enum.SignInNums:
m.SignInNums = utils.StrToInt(value)
case enum.ImActivityNums:
m.ImActivityNums = utils.StrToInt(value)
case enum.SendRedPackageNums:
m.SendRedPackageNums = utils.StrToInt(value)
case enum.EsEggEnergyExchangeAccountBalance:
m.EggEnergyExchangeAccountBalance = utils.StrToInt(value)
case enum.AccountBalanceExchangeEggEnergyNums:
m.AccountBalanceExchangeEggEnergyNums = utils.StrToInt(value)
case enum.SendCircleOfFriendNums:
m.SendCircleOfFriendNums = utils.StrToInt(value)
case enum.ForumCommentsNums:
m.ForumCommentsNums = utils.StrToInt(value)
case enum.CollegeLearningNums:
m.CollegeLearningNums = utils.StrToInt(value)
case enum.ViolateNums:
m.ViolateNums = utils.StrToInt(value)
case enum.BrowseInterfaceNums:
m.BrowseInterfaceNums = utils.StrToInt(value)
case enum.PersonAddActivityValue:
m.PersonAddActivityValue = utils.StrToInt(value)
default:
}
createDoc, err1 := es.CreateDoc(index, id, m)
if err1 != nil {
fmt.Println("EggCanalPersonAddActivityValueConsumeCreateDoc_ERR::::", "kind===>", kind, "::::::", err1.Error())
return err1
}
fmt.Println("createDoc==========>", createDoc)
return nil
}

+ 62
- 0
rule/egg_energy/enum/es_egg_energy_score_enum.go Parādīt failu

@@ -0,0 +1,62 @@
package enum

// EggEnergyUserEggScoreEsKind 蛋蛋分属性类型
type EggEnergyUserEggScoreEsKind int

const (
ScoreValue = iota + 1
ScoreValueKind
Ecpm
InviteUserNums
TeamActivityNums
SignInNums
ImActivityNums
SendRedPackageNums
EsEggEnergyExchangeAccountBalance
AccountBalanceExchangeEggEnergyNums
SendCircleOfFriendNums
ForumCommentsNums
CollegeLearningNums
ViolateNums
BrowseInterfaceNums
PersonAddActivityValue
)

func (kind EggEnergyUserEggScoreEsKind) String() string {
switch kind {
case ScoreValue:
return "蛋蛋分"
case ScoreValueKind:
return "蛋蛋分类型"
case Ecpm:
return "Ecpm"
case InviteUserNums:
return "拉新人数"
case TeamActivityNums:
return "团队活跃次数"
case SignInNums:
return "签到次数"
case ImActivityNums:
return "im活跃次数"
case SendRedPackageNums:
return "发红包次数"
case EsEggEnergyExchangeAccountBalance:
return "蛋蛋能量兑换余额数量"
case AccountBalanceExchangeEggEnergyNums:
return "余额兑换蛋蛋能量数量"
case SendCircleOfFriendNums:
return "发朋友圈次数"
case ForumCommentsNums:
return "论坛评论次数"
case CollegeLearningNums:
return "学院学习次数"
case ViolateNums:
return "违规次数"
case BrowseInterfaceNums:
return "浏览界面次数"
case PersonAddActivityValue:
return "个人活跃积分"
default:
return "未知项目"
}
}

Notiek ielāde…
Atcelt
Saglabāt