From 58a5f623d3cbc672998eff55039b0d0076d9a105 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 17 Dec 2024 22:51:18 +0800 Subject: [PATCH 01/10] update --- .../activity_coin_ready_exchange_egg_energy.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go b/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go index 083f78c..0e5d5d4 100644 --- a/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go +++ b/rule/egg_energy/activity_coin_ready_exchange_egg_energy.go @@ -16,6 +16,18 @@ import ( // ActivityCoinReadyExchangeEggEnergy 蛋蛋积分【准备】兑换成蛋蛋能量 func ActivityCoinReadyExchangeEggEnergy(engine *xorm.Engine, uid int64, ch *rabbit.Channel) (err error) { + //TODO::判断是否存在正在签到记录 + var eggSignIn model.EggSignIn + has, err := engine.Where("uid = ? and is_completed =?", uid, 0). + Get(&eggSignIn) + if err != nil { + return + } + if has { + err = errors.New("重复签到~~~") + return + } + //1、查找`egg_energy_basic_setting` 基础设置 eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine) eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{ @@ -123,7 +135,7 @@ func ActivityCoinReadyExchangeEggEnergy(engine *xorm.Engine, uid int64, ch *rabb //7、新增 `egg_energy_user_activity` 记录 var m model.EggEnergyUserActivity - has, err := engine.Where("uid =? and date =?", uid, now.Format("2006-01-02")).Get(&m) + has, err = engine.Where("uid =? and date =?", uid, now.Format("2006-01-02")).Get(&m) if err != nil { return err } From f7877f8f1d5c3ab016955df404df2c37a2150f00 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 17 Dec 2024 23:07:33 +0800 Subject: [PATCH 02/10] update --- .../activity_coin_start_exchange_egg_person_energy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rule/egg_energy/activity_coin_start_exchange_egg_person_energy.go b/rule/egg_energy/activity_coin_start_exchange_egg_person_energy.go index 8c76bd7..87c8a33 100644 --- a/rule/egg_energy/activity_coin_start_exchange_egg_person_energy.go +++ b/rule/egg_energy/activity_coin_start_exchange_egg_person_energy.go @@ -54,7 +54,7 @@ func ActivityCoinStartExchangeEggEnergy(engine *xorm.Engine, req md.EggEnergyStr Kind: "sub", Title: enum.EggPointCoinToExchangeToTeamEggEnergy.String(), TransferType: int(enum.EggPointCoinToExchangeToTeamEggEnergy), - CoinId: req.TeamEnergyCoinId, + CoinId: req.TeamPointCoinId, Uid: req.Uid, Amount: egg_system_rules.StrToFloat64(sign.TotalTeamEggPoints), }) From 44239d7e3e2647e53047173a5cf7a0d423356a91 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Wed, 18 Dec 2024 10:28:13 +0800 Subject: [PATCH 03/10] update EggFriendCircleLikeEsMapping mapping --- md/es.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/md/es.go b/md/es.go index 00cfd7c..6177b90 100644 --- a/md/es.go +++ b/md/es.go @@ -309,7 +309,7 @@ const EggFriendCircleLikeEsMapping = ` "number_of_replicas" : 1 }, "aliases": { - "egg_friend_circle": {} + "egg_friend_circle_like": {} }, "mappings":{ "properties":{ From 46ebf4dca6fb2a29fcc5d88aef08ebf124e7ee16 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Wed, 18 Dec 2024 16:13:32 +0800 Subject: [PATCH 04/10] update es struct --- md/es.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/md/es.go b/md/es.go index 6177b90..8e9520d 100644 --- a/md/es.go +++ b/md/es.go @@ -202,10 +202,10 @@ const EggFriendCircleCommentEsMapping = ` "type": "integer" }, "circle_id":{ - "type": "integer" + "type": "keyword" }, "comment_id":{ - "type": "integer" + "type": "keyword" }, "reply_comment_id":{ "type": "integer" @@ -317,7 +317,7 @@ const EggFriendCircleLikeEsMapping = ` "type": "integer" }, "circle_id":{ - "type": "integer" + "type": "keyword" }, "created_at":{ "type": "date", From 34181bb6bcbc8b9eb2b37ae84b1a087678610fe3 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Wed, 18 Dec 2024 16:34:35 +0800 Subject: [PATCH 05/10] update comment struct --- md/es.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/md/es.go b/md/es.go index 8e9520d..cc24692 100644 --- a/md/es.go +++ b/md/es.go @@ -208,7 +208,7 @@ const EggFriendCircleCommentEsMapping = ` "type": "keyword" }, "reply_comment_id":{ - "type": "integer" + "type": "keyword" }, "content":{ "type": "keyword" From fc3cab9bffe499642174ac56aff3f5b64342833c Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 18 Dec 2024 23:54:29 +0800 Subject: [PATCH 06/10] update --- rule/egg_energy/give_activty_coin.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rule/egg_energy/give_activty_coin.go b/rule/egg_energy/give_activty_coin.go index b2664e4..c367834 100644 --- a/rule/egg_energy/give_activty_coin.go +++ b/rule/egg_energy/give_activty_coin.go @@ -31,6 +31,16 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin uid := user.Id now := time.Now() + //TODO::拒绝重复异常回调 + redisKey := fmt.Sprintf(md2.UserNextWatchAdDate, uid) + nextWatchAdDate, _ := cache.GetString(redisKey) + if nextWatchAdDate != "" { + nextWatchAdDateValue := egg_system_rules.String2Time(nextWatchAdDate) + if nextWatchAdDateValue.After(time.Now()) { + return 0, errors.New("未到可观看时间~~") + } + } + //1、查找 `egg_energy_basic_setting` 基础设置 eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine) eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{ @@ -315,7 +325,7 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin return rewardValue, err2 } } - redisKey := fmt.Sprintf(md2.UserNextWatchAdDate, uid) + var watchAdDate string if eggEnergyUserWatchRecords.ResidueWatchAdNum == egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum) { if eggEnergyUserWatchRecords.NextWatchAdDate.Before(time.Now()) { From 9a445f95a29a6d67ad270a91e49be8089ffa0a8c Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 19 Dec 2024 11:50:15 +0800 Subject: [PATCH 07/10] update --- rule/egg_energy/give_activty_coin.go | 5 +++++ rule/egg_energy/md/mq_egg_energy.go | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/rule/egg_energy/give_activty_coin.go b/rule/egg_energy/give_activty_coin.go index c367834..23a24b4 100644 --- a/rule/egg_energy/give_activty_coin.go +++ b/rule/egg_energy/give_activty_coin.go @@ -275,6 +275,11 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin Uid: vv.Uid, Amount: vv.RewardValue, }, md2.EggEnergyRoutKeyForSettlementPublicGiveActivityCoin) + ch.Publish(md2.EggEnergyExchange, md2.EggEnergyTeamAssistanceReq{ + AssistanceUid: uid, + Uid: vv.Uid, + AssistanceValue: vv.RewardValue, + }, md2.EggEnergyTeamAssistance) } } err = session.Commit() diff --git a/rule/egg_energy/md/mq_egg_energy.go b/rule/egg_energy/md/mq_egg_energy.go index b86ca92..2fd8e78 100644 --- a/rule/egg_energy/md/mq_egg_energy.go +++ b/rule/egg_energy/md/mq_egg_energy.go @@ -5,6 +5,7 @@ const EggEnergyExchange = "egg.energy" const ( EggEnergyRoutKeyForStarLevelDividend = "star_level_dividend" // 星级分红 EggEnergyRoutKeyForSettlementPublicGiveActivityCoin = "settlement_public_give_activity_coin" // 计算观看激励视屏得到活跃积分 + EggEnergyTeamAssistance = "egg_energy_team_assistance" // 团队助力 EggEnergyRoutKeyForStartExchangeGreenEnergy = "start_exchange_egg_energy" // 开始兑换蛋蛋能量 EggEnergyRoutKeyForAutoExchangeGreenEnergy = "auto_exchange_egg_energy" // 自动兑换蛋蛋能量 EggEnergyRoutKeyForEggEnergyFundData = "fund_data" // 资金汇入 @@ -13,6 +14,12 @@ const ( EggEnergyRoutKeyForDealUserEcpm = "user_ecpm" // 处理给用户Ecpm值 ) +type EggEnergyTeamAssistanceReq struct { + Uid int64 `json:"uid"` + AssistanceUid int64 `json:"assistance_uid"` + AssistanceValue float64 `json:"assistance_value"` +} + type EggEnergyStructForSignIn struct { MasterId string `json:"master_id"` Uid int `json:"uid"` From 96fa61edf3c630148454010008bcf852de9c0bab Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 19 Dec 2024 12:25:24 +0800 Subject: [PATCH 08/10] update --- rule/egg_energy/give_activty_coin.go | 6 ++++-- rule/egg_energy/md/mq_egg_energy.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rule/egg_energy/give_activty_coin.go b/rule/egg_energy/give_activty_coin.go index 23a24b4..578ef38 100644 --- a/rule/egg_energy/give_activty_coin.go +++ b/rule/egg_energy/give_activty_coin.go @@ -209,10 +209,10 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin return } fatherRewardValue := rewardValue * (egg_system_rules.StrToFloat64(directPushRewardSetting.RewardRateValue) / 100) + var fatherSign model.EggSignIn if directPushRewardSetting.MemberSelfIsOpenGetTeamReward == "1" { fmt.Println("user:::::::::::::", user) - var m model.EggSignIn - has, err44 := engine.Where("uid =?", user.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m) + has, err44 := engine.Where("uid =?", user.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&fatherSign) if err44 != nil { return rewardValue, err44 } @@ -279,6 +279,8 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin AssistanceUid: uid, Uid: vv.Uid, AssistanceValue: vv.RewardValue, + SignStart: fatherSign.StartTime, + SignEnd: fatherSign.EndTime, }, md2.EggEnergyTeamAssistance) } } diff --git a/rule/egg_energy/md/mq_egg_energy.go b/rule/egg_energy/md/mq_egg_energy.go index 2fd8e78..c2ddd54 100644 --- a/rule/egg_energy/md/mq_egg_energy.go +++ b/rule/egg_energy/md/mq_egg_energy.go @@ -18,6 +18,8 @@ type EggEnergyTeamAssistanceReq struct { Uid int64 `json:"uid"` AssistanceUid int64 `json:"assistance_uid"` AssistanceValue float64 `json:"assistance_value"` + SignStart string `json:"sign_start"` + SignEnd string `json:"sign_end"` } type EggEnergyStructForSignIn struct { From d4f486db7106f661878982028dedeb08fe22102f Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 19 Dec 2024 12:36:22 +0800 Subject: [PATCH 09/10] update --- enum/user_virtual_amount_flow.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/enum/user_virtual_amount_flow.go b/enum/user_virtual_amount_flow.go index cd45022..18e5022 100644 --- a/enum/user_virtual_amount_flow.go +++ b/enum/user_virtual_amount_flow.go @@ -19,6 +19,7 @@ const ( EggEnergyVideoRewardPersonalActiveCoin EggEnergyPlayletRewardPersonalActiveCoin EggEnergyWatchAdRewardFansActiveCoin + EggEnergyRecruitNewUsersReward ) func (kind UserVirtualAmountFlowTransferType) String() string { @@ -53,6 +54,8 @@ func (kind UserVirtualAmountFlowTransferType) String() string { return "观看短剧" //观看短剧-个人蛋蛋积分 case EggEnergyWatchAdRewardFansActiveCoin: return "粉丝奖励" //浏览视频奖励-直推奖励蛋蛋积分 + case EggEnergyRecruitNewUsersReward: + return "拉新奖励" //浏览视频奖励-直推奖励蛋蛋积分 default: return "未知状态" } From 3f6b3590ae7598b0033c0450986800b5c5539a44 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 19 Dec 2024 12:36:45 +0800 Subject: [PATCH 10/10] 1 --- enum/user_virtual_amount_flow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enum/user_virtual_amount_flow.go b/enum/user_virtual_amount_flow.go index 18e5022..631c144 100644 --- a/enum/user_virtual_amount_flow.go +++ b/enum/user_virtual_amount_flow.go @@ -55,7 +55,7 @@ func (kind UserVirtualAmountFlowTransferType) String() string { case EggEnergyWatchAdRewardFansActiveCoin: return "粉丝奖励" //浏览视频奖励-直推奖励蛋蛋积分 case EggEnergyRecruitNewUsersReward: - return "拉新奖励" //浏览视频奖励-直推奖励蛋蛋积分 + return "拉新奖励" default: return "未知状态" }