From 80726ae26c4926b6368afee06a5537b661b5b6a4 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 13 Dec 2024 15:58:01 +0800 Subject: [PATCH] update egg canal type --- consume/egg_canal_invite_user_nums_consume.go | 2 +- consume/egg_canal_person_add_activity_value_consume.go | 4 ++-- consume/egg_canal_violate_nums_consume.go | 4 ++-- .../md_egg_canal_person_add_activity_value_consume.go | 10 +++++----- consume/md/md_egg_canal_user_relate_consume.go | 8 ++++---- consume/md/md_egg_canal_violate_nums_consume.go | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/consume/egg_canal_invite_user_nums_consume.go b/consume/egg_canal_invite_user_nums_consume.go index e9bb3ba..daa008f 100644 --- a/consume/egg_canal_invite_user_nums_consume.go +++ b/consume/egg_canal_invite_user_nums_consume.go @@ -71,7 +71,7 @@ func handleEggCanalInviteUserNumsConsume(msg []byte) error { if canalMsg.Type == md2.CanalMsgInsertSqlType { for _, item := range canalMsg.Data { parentUid := item.ParentUid - id := fmt.Sprintf("%d%d-%d", year, week, parentUid) + id := fmt.Sprintf("%d%d-%s", year, week, parentUid) fmt.Println("ESid:" + id + "=====================>") // 新增拉新人数 diff --git a/consume/egg_canal_person_add_activity_value_consume.go b/consume/egg_canal_person_add_activity_value_consume.go index 90c5c63..99d5f59 100644 --- a/consume/egg_canal_person_add_activity_value_consume.go +++ b/consume/egg_canal_person_add_activity_value_consume.go @@ -80,9 +80,9 @@ func handleEggCanalPersonAddActivityValueConsume(msg []byte) error { if canalMsg.Type == md2.CanalMsgInsertSqlType { for _, item := range canalMsg.Data { uid := item.Uid - id := fmt.Sprintf("%d%d-%d", year, week, uid) + id := fmt.Sprintf("%d%d-%s", year, week, uid) - if item.CoinId != personEggPointsCoinId && item.Direction != 1 { + if item.CoinId != utils2.IntToStr(personEggPointsCoinId) && item.Direction != "1" { continue } diff --git a/consume/egg_canal_violate_nums_consume.go b/consume/egg_canal_violate_nums_consume.go index cb42785..a2d0e0b 100644 --- a/consume/egg_canal_violate_nums_consume.go +++ b/consume/egg_canal_violate_nums_consume.go @@ -85,7 +85,7 @@ func handleEggCanalViolateNumsConsume(msg []byte) error { continue } uid := item.Uid - id := fmt.Sprintf("%d%d-%d", year, week, uid) + id := fmt.Sprintf("%d%d-%s", year, week, uid) // 2.2. 增加违规次数记录 script := elastic.NewScript("ctx._source.violate_nums += params.inc").Param("inc", 1) @@ -115,7 +115,7 @@ func handleEggCanalViolateNumsConsume(msg []byte) error { continue } uid := item.Uid - id := fmt.Sprintf("%d%d-%d", year, week, uid) + id := fmt.Sprintf("%d%d-%s", year, week, uid) // 3.2 减少违规次数记录 script := elastic.NewScript("ctx._source.violate_nums -= params.dec").Param("dec", 1) diff --git a/consume/md/md_egg_canal_person_add_activity_value_consume.go b/consume/md/md_egg_canal_person_add_activity_value_consume.go index 09e09e9..de27fae 100644 --- a/consume/md/md_egg_canal_person_add_activity_value_consume.go +++ b/consume/md/md_egg_canal_person_add_activity_value_consume.go @@ -1,16 +1,16 @@ package md type CanalUserVirtualCoinFlow struct { - Id int64 `json:"id"` - Uid int64 `json:"uid"` - CoinId int `json:"coin_id"` - Direction int `json:"direction"` + Id string `json:"id"` + Uid string `json:"uid"` + CoinId string `json:"coin_id"` + Direction string `json:"direction"` Title string `json:"title"` Amount string `json:"amount"` BeforeAmount string `json:"before_amount"` AfterAmount string `json:"after_amount"` SysFee string `json:"sys_fee"` - TransferType int `json:"transfer_type"` + TransferType string `json:"transfer_type"` } type CanalUserVirtualCoinFlowMessage[T any] struct { diff --git a/consume/md/md_egg_canal_user_relate_consume.go b/consume/md/md_egg_canal_user_relate_consume.go index 7bb22d7..862b58d 100644 --- a/consume/md/md_egg_canal_user_relate_consume.go +++ b/consume/md/md_egg_canal_user_relate_consume.go @@ -1,10 +1,10 @@ package md type CanalUserRelate struct { - Id int64 `json:"id"` - ParentUid int64 `json:"parent_uid"` - Uid int64 `json:"uid"` - Level int `json:"level"` + Id string `json:"id"` + ParentUid string `json:"parent_uid"` + Uid string `json:"uid"` + Level string `json:"level"` InviteTime string `json:"invite_time"` } diff --git a/consume/md/md_egg_canal_violate_nums_consume.go b/consume/md/md_egg_canal_violate_nums_consume.go index 297e8cd..7ca5ff7 100644 --- a/consume/md/md_egg_canal_violate_nums_consume.go +++ b/consume/md/md_egg_canal_violate_nums_consume.go @@ -1,9 +1,9 @@ package md type CanalTagRecords struct { - Id int `json:"id" ` - TagId int `json:"tag_id" ` - Uid int64 `json:"uid" ` + Id string `json:"id" ` + TagId string `json:"tag_id" ` + Uid string `json:"uid" ` Memo string `json:"memo" ` CreateAt string `json:"create_at" ` UpdateAt string `json:"update_at" `