diff --git a/md/es.go b/md/es.go index 72f428f..7b03889 100644 --- a/md/es.go +++ b/md/es.go @@ -28,7 +28,7 @@ const EggEnergyUserEggScoreEsMapping = ` "type": "short" }, "ecpm":{ - "type": "float" + "type": "double" }, "invite_user_nums":{ "type": "integer" @@ -67,7 +67,7 @@ const EggEnergyUserEggScoreEsMapping = ` "type": "integer" }, "person_add_activity_value":{ - "type": "integer" + "type": "double" }, "created_at":{ "type": "date", @@ -98,7 +98,7 @@ type EggEnergyUserEggScoreEs struct { CollegeLearningNums int `json:"college_learning_nums" label:"学院学习次数"` ViolateNums int `json:"violate_nums" label:"违规次数"` BrowseInterfaceNums int `json:"browse_interface_nums" label:"浏览界面次数"` - PersonAddActivityValue int `json:"person_add_activity_value" label:"个人活跃积分"` + PersonAddActivityValue float64 `json:"person_add_activity_value" label:"个人活跃积分"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` } diff --git a/rule/egg_energy/create_es_score_and_assign_value.go b/rule/egg_energy/create_es_score_and_assign_value.go index a0d75a4..d3a72e0 100644 --- a/rule/egg_energy/create_es_score_and_assign_value.go +++ b/rule/egg_energy/create_es_score_and_assign_value.go @@ -46,7 +46,7 @@ func CreateEsScoreAndAssignValuesDoc(index, id string, uid int64, kind enum.EggE case enum.BrowseInterfaceNums: m.BrowseInterfaceNums = utils.StrToInt(value) case enum.PersonAddActivityValue: - m.PersonAddActivityValue = utils.StrToInt(value) + m.PersonAddActivityValue = utils.StrToFloat64(value) default: } createDoc, err1 := es.CreateDoc(index, id, m) diff --git a/rule/egg_energy/md/mq_egg_app.go b/rule/egg_energy/md/mq_egg_app.go index 80443a5..9d1fadf 100644 --- a/rule/egg_energy/md/mq_egg_app.go +++ b/rule/egg_energy/md/mq_egg_app.go @@ -10,6 +10,7 @@ const ( EggRoutKeyForRecordActive = "egg_record_active" // 更新活跃记录 EggRoutKeyForAutoScoreData = "egg_auto_score" // 自动打分 EggRoutKeyForSendFriendCircle = "egg_send_friend_circle" // 发送朋友圈 + EggRoutKeyForComment = "egg_comment" // 发送朋友圈 ) type EggNewUserRegisterData struct { @@ -62,7 +63,7 @@ type EggStructForAutoScoreData struct { CollegeLearningNums int `json:"college_learning_nums"` ViolateNums int `json:"violate_nums"` BrowseInterfaceNums int `json:"browse_interface_nums"` - PersonAddActivityValue int `json:"person_add_activity_value"` + PersonAddActivityValue float64 `json:"person_add_activity_value"` } type AddPublicPlatoonUserRelationCommissionReq struct { @@ -73,3 +74,7 @@ type AddPublicPlatoonUserRelationCommissionReq struct { type EggSendFriendCircleData struct { Uid int64 `json:"uid"` } + +type EggCommentData struct { + Uid int64 `json:"uid"` +} diff --git a/utils/es/base.go b/utils/es/base.go index 0efc29e..8c7286d 100644 --- a/utils/es/base.go +++ b/utils/es/base.go @@ -22,10 +22,10 @@ func GetLatestEffectiveIndexFromAlias(now time.Time) string { year, week := now.ISOWeek() if now.Weekday() > time.Wednesday || (now.Weekday() > time.Wednesday && now.Hour() > 14) { // 当前已经过了周三下午两点 返回上周蛋蛋分 - esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week-10) + esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week) } else { // 没过周三下午两点 返回上上周蛋蛋分 - esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week-20) + esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week) } return esIndexName }