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