From bc693b509ba4e7a12558a0d7726c9568bb0b7f2b Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 13 Nov 2024 19:50:26 +0800 Subject: [PATCH 1/3] update --- enum/user_wallet_fllow.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 enum/user_wallet_fllow.go diff --git a/enum/user_wallet_fllow.go b/enum/user_wallet_fllow.go new file mode 100644 index 0000000..92f859a --- /dev/null +++ b/enum/user_wallet_fllow.go @@ -0,0 +1,26 @@ +package enum + +// UserWalletFlowTransferType 用户钱包流水-类型 +type UserWalletFlowTransferType int + +const ( + AdministratorOperationAddBalance UserWalletFlowTransferType = iota + 1 + AdministratorOperationSubBalance + EggEnergyExchangeAccountBalance + AccountBalanceExchangeEggEnergy +) + +func (kind UserWalletFlowTransferType) String() string { + switch kind { + case AdministratorOperationAddBalance: + return "管理员操作增加余额" + case AdministratorOperationSubBalance: + return "管理员操作扣除余额" + case EggEnergyExchangeAccountBalance: + return "蛋蛋能量兑换余额" + case AccountBalanceExchangeEggEnergy: + return "余额兑换蛋蛋能量" + default: + return "未知状态" + } +} From b77e324a8f00a251ae2237ac8497e2618ebbca75 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 13 Nov 2024 19:57:16 +0800 Subject: [PATCH 2/3] update --- .../deal_available_green_energy_points.go | 18 ++++++++++++++++-- .../enum/available_egg_energy_points_flow.go | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/rule/egg_energy/deal_available_green_energy_points.go b/rule/egg_energy/deal_available_green_energy_points.go index 30b4c47..879ea22 100644 --- a/rule/egg_energy/deal_available_green_energy_points.go +++ b/rule/egg_energy/deal_available_green_energy_points.go @@ -13,7 +13,6 @@ import ( ) func DealAvailableEggEnergyCoin(session *xorm.Session, kind int, eggEnergyCoreData *model.EggEnergyCoreData, req md2.DealAvailableEggEnergyCoinReq) error { - if eggEnergyCoreData == nil { //TODO::存在使用风险 // 查找 `egg_energy_core_data` 基础设置 eggEnergyCoreDataModel, cb, err := svc.GetEggEnergyCoreData(session.Engine()) @@ -90,7 +89,6 @@ func DealAvailableEggEnergyCoin(session *xorm.Session, kind int, eggEnergyCoreDa eggEnergyAvailableEnergyFlow.AfterDestructionQuantityValues = eggEnergyCoreData.DestructionQuantityNums break case int(enum.EggEnergyExchangeAccountBalance): //蛋蛋能量兑换余额 - //查找`egg_energy_basic_setting` 基础设置 eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(session.Engine()) eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{ "key": "is_open", @@ -246,6 +244,22 @@ func DealAvailableEggEnergyCoin(session *xorm.Session, kind int, eggEnergyCoreDa eggEnergyAvailableEnergyFlow.BeforeMarketplaceMerchantFundValues = eggEnergyCoreData.MarketplaceMerchantFunds eggEnergyAvailableEnergyFlow.AfterMarketplaceMerchantFundValues = marketplaceMerchantFunds.Sub(amountValue).RoundFloor(8).String() + eggEnergyAvailableEnergyFlow.BeforeDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee //发展委员会 + eggEnergyAvailableEnergyFlow.AfterDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee + eggEnergyAvailableEnergyFlow.BeforePublicWelfareAndCharityValues = eggEnergyCoreData.PublicWelfareAndCharity //公益慈善 + eggEnergyAvailableEnergyFlow.AfterPublicWelfareAndCharityValues = eggEnergyCoreData.PublicWelfareAndCharity + eggEnergyAvailableEnergyFlow.BeforeStarLevelDividendsValues = eggEnergyCoreData.StarLevelDividends //星级分红 + eggEnergyAvailableEnergyFlow.AfterStarLevelDividendsValues = eggEnergyCoreData.StarLevelDividends + eggEnergyAvailableEnergyFlow.BeforeCommunityDividends = eggEnergyCoreData.CommunityDividends //社区分红 + eggEnergyAvailableEnergyFlow.AfterCommunityDividends = eggEnergyCoreData.CommunityDividends + eggEnergyAvailableEnergyFlow.BeforeDestructionQuantityValues = eggEnergyCoreData.DestructionQuantityNums //销毁数量 + eggEnergyAvailableEnergyFlow.AfterDestructionQuantityValues = eggEnergyCoreData.DestructionQuantityNums + break + case int(enum.CapitalInjection): //资金汇入 + eggEnergyAvailableEnergyFlow.BeforeMarketplaceMerchantValues = eggEnergyCoreData.MarketplaceMerchantNums //市商数量 + eggEnergyAvailableEnergyFlow.AfterMarketplaceMerchantValues = eggEnergyCoreData.MarketplaceMerchantNums + eggEnergyAvailableEnergyFlow.BeforeMarketplaceMerchantFundValues = eggEnergyCoreData.MarketplaceMerchantFunds //市商资金 + eggEnergyAvailableEnergyFlow.AfterMarketplaceMerchantFundValues = eggEnergyCoreData.MarketplaceMerchantFunds eggEnergyAvailableEnergyFlow.BeforeDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee //发展委员会 eggEnergyAvailableEnergyFlow.AfterDevelopmentCommitteeValues = eggEnergyCoreData.DevelopmentCommittee eggEnergyAvailableEnergyFlow.BeforePublicWelfareAndCharityValues = eggEnergyCoreData.PublicWelfareAndCharity //公益慈善 diff --git a/rule/egg_energy/enum/available_egg_energy_points_flow.go b/rule/egg_energy/enum/available_egg_energy_points_flow.go index 3addab8..1cfd702 100644 --- a/rule/egg_energy/enum/available_egg_energy_points_flow.go +++ b/rule/egg_energy/enum/available_egg_energy_points_flow.go @@ -13,6 +13,7 @@ const ( PlatformProfitability MarketplaceMerchantNumsAutoExchangeMarketplaceMerchantFunds MarketplaceMerchantFundsAutoExchangeMarketplaceMerchantNums + CapitalInjection ) func (kind EggEnergyAvailableEnergyFlowKind) String() string { From dd947fba54caef06a52563d8f0d4ad4751a93e1b Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 13 Nov 2024 20:02:19 +0800 Subject: [PATCH 3/3] update --- rule/egg_energy/md/mq.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rule/egg_energy/md/mq.go b/rule/egg_energy/md/mq.go index 2df241d..c0b61d7 100644 --- a/rule/egg_energy/md/mq.go +++ b/rule/egg_energy/md/mq.go @@ -5,17 +5,11 @@ const EggEnergyExchange = "egg.energy" const ( EggEnergyRoutKeyForStarLevelDividend = "star_level_dividend" // 星级分红 EggEnergyRoutKeyForSettlementPublicGiveActivityCoin = "settlement_public_give_activity_coin" // 计算观看激励视屏得到活跃积分 - EggEnergyRoutKeyForReadyExchangeGreenEnergyToPerson = "ready_exchange_egg_energy_to_person" // 准备兑换个人蛋蛋能量 EggEnergyRoutKeyForStartExchangeGreenEnergyToPerson = "start_exchange_egg_energy_to_person" // 开始兑换个人蛋蛋能量 EggEnergyRoutKeyForAutoExchangeGreenEnergyToPerson = "auto_exchange_egg_energy_to_person" // 自动兑换个人蛋蛋能量 - EggEnergyRoutKeyForReadyExchangeGreenEnergyToTeam = "ready_exchange_egg_energy_to_team" // 自动兑换团队蛋蛋能量 EggEnergyRoutKeyForStartExchangeGreenEnergyToTeam = "start_exchange_egg_energy_to_team" // 开始兑换团队蛋蛋能量 EggEnergyRoutKeyForAutoExchangeGreenEnergyToTeam = "auto_exchange_egg_energy_to_team" // 自动兑换团队蛋蛋能量 - EggEnergyRoutKeyForSignIn = "sign_in" // 签到 - EggEnergyRoutKeyForSignInUpdateRecords = "sign_in_update_records" // 签到更新记录 - EggEnergyRoutKeyForRewardUserCoin = "reward_user_coin" // 奖励用户虚拟币 - ) type EggEnergyStructForSignIn struct {