|
@@ -79,7 +79,6 @@ func handleEggCanalPersonAddActivityValueConsume(msg []byte) error { |
|
|
// 2. 监听插入信息 |
|
|
// 2. 监听插入信息 |
|
|
if canalMsg.Type == md2.CanalMsgInsertSqlType { |
|
|
if canalMsg.Type == md2.CanalMsgInsertSqlType { |
|
|
for _, item := range canalMsg.Data { |
|
|
for _, item := range canalMsg.Data { |
|
|
fmt.Println("item======>", item) |
|
|
|
|
|
uid := item.Uid |
|
|
uid := item.Uid |
|
|
id := fmt.Sprintf("%d%d_%s", year, week, uid) |
|
|
id := fmt.Sprintf("%d%d_%s", year, week, uid) |
|
|
|
|
|
|
|
@@ -88,8 +87,8 @@ func handleEggCanalPersonAddActivityValueConsume(msg []byte) error { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 3. 增加个人活跃积分 |
|
|
// 3. 增加个人活跃积分 |
|
|
fmt.Println("amount==========>", item.Amount) |
|
|
|
|
|
script := elastic.NewScript("ctx._source.person_add_activity_value += params.inc").Param("inc", utils2.StrToInt(item.Amount)) |
|
|
|
|
|
|
|
|
amount := utils2.StrToFloat64(item.Amount) |
|
|
|
|
|
script := elastic.NewScript("ctx._source.person_add_activity_value += params.inc").Param("inc", int(amount)) |
|
|
updateDoc, err := es.EsClient.Update(). |
|
|
updateDoc, err := es.EsClient.Update(). |
|
|
Index(index). |
|
|
Index(index). |
|
|
Id(id). |
|
|
Id(id). |
|
|