Browse Source

fix: update auto score struct

master
shenjiachi 1 week ago
parent
commit
4c0ba44ad1
3 changed files with 56 additions and 3 deletions
  1. +53
    -0
      consume/egg_canal_energy_exchange_account_consume_test.go
  2. +2
    -2
      consume/md/md_egg_energy_auto_score_consume.go
  3. +1
    -1
      go.mod

+ 53
- 0
consume/egg_canal_energy_exchange_account_consume_test.go View File

@@ -0,0 +1,53 @@
package consume

import (
"applet/consume/md"
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
"testing"
"time"
)

func TestEggCanalEnergyExchangeAccountConsume(t *testing.T) {
data := md.CanalEnergyExchangeAccount{
Id: "1",
Uid: "16",
Direction: "1",
Amount: "4.88000000",
BeforeAmount: "0",
AfterAmount: "3.88000000",
SysFee: "0",
OrdId: "",
Title: "蛋蛋能量兑换余额",
Kind: "3",
State: "0",
Memo: "手动测试数据",
CreateAt: "",
UpdateAt: "",
}

message := md.CanalEnergyExchangeAccountMessage[md.CanalEnergyExchangeAccount]{
Data: []md.CanalEnergyExchangeAccount{data},
Database: "test_db",
ES: time.Now().UnixNano(),
ID: 1,
IsDdl: false,
Old: nil,
PkNames: []string{"id"},
Table: "egg_canal_user_wallet_flow",
TS: time.Now().Unix(),
Type: "INSERT",
}

err := rabbit.Init("120.77.153.180", "5672", "guest", "guest")
if err != nil {
return
}
ch, err := rabbit.Cfg.Pool.GetChannel()
if err != nil {
return
}
defer ch.Release()
ch.Publish(md2.EggCanalExchange, message, "egg_canal_user_wallet_flow")

}

+ 2
- 2
consume/md/md_egg_energy_auto_score_consume.go View File

@@ -7,8 +7,8 @@ type GetPredictReq struct {
SignInNums int `json:"sign_in_nums"`
ImActivityNums int `json:"im_activity_nums"`
SendRedPackageNums int `json:"send_red_package_nums"`
EggEnergyExchangeAccountBalance int `json:"egg_energy_exchange_account_balance"`
AccountBalanceExchangeEggEnergyNums int `json:"account_balance_exchange_egg_energy_nums"`
EggEnergyExchangeAccountBalance float64 `json:"egg_energy_exchange_account_balance"`
AccountBalanceExchangeEggEnergyNums float64 `json:"account_balance_exchange_egg_energy_nums"`
SendCircleOfFriendNums int `json:"send_circle_of_friend_nums"`
ForumCommentsNums int `json:"forum_comments_nums"`
CollegeLearningNums int `json:"college_learning_nums"`


+ 1
- 1
go.mod View File

@@ -8,7 +8,7 @@ go 1.19

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241224090637-89a57f7fbb1e
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241226091556-c909dd302df7
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241226101642-a072d33f3449
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
github.com/boombuler/barcode v1.0.1


Loading…
Cancel
Save