Browse Source

Merge remote-tracking branch 'origin/master'

master
huangjiajun 1 week ago
parent
commit
900df39ecc
4 changed files with 12 additions and 7 deletions
  1. +3
    -3
      md/es.go
  2. +1
    -1
      rule/egg_energy/create_es_score_and_assign_value.go
  3. +6
    -1
      rule/egg_energy/md/mq_egg_app.go
  4. +2
    -2
      utils/es/base.go

+ 3
- 3
md/es.go View File

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


+ 1
- 1
rule/egg_energy/create_es_score_and_assign_value.go View File

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


+ 6
- 1
rule/egg_energy/md/mq_egg_app.go View File

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

+ 2
- 2
utils/es/base.go View File

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

Loading…
Cancel
Save