蛋蛋星球RabbitMq消费项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

egg_fin_withdraw_apply_consume_test.go 1.3 KiB

4 days ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package consume
  2. import (
  3. "applet/app/cfg"
  4. "applet/app/db"
  5. md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
  6. "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
  7. "fmt"
  8. "testing"
  9. )
  10. func TestHandleEggFinWithdrawApplyDataConsume(t *testing.T) {
  11. dbcfg := cfg.DBCfg{
  12. Host: "119.23.182.117:3306",
  13. Name: "egg",
  14. User: "root",
  15. Psw: "Fnuo123com@",
  16. ShowLog: true,
  17. MaxLifetime: 30,
  18. MaxOpenConns: 100,
  19. MaxIdleConns: 100,
  20. Path: "tmp/%s.log",
  21. }
  22. db.InitDB(&dbcfg)
  23. err := rabbit.Init("120.77.153.180", "5672", "guest", "guest")
  24. if err != nil {
  25. return
  26. }
  27. ch, err := rabbit.Cfg.Pool.GetChannel()
  28. if err != nil {
  29. fmt.Println("DealFundDataGetRabbitChannel_ERR:::::", err.Error())
  30. return
  31. }
  32. defer ch.Release()
  33. ch.Publish(md2.EggAppExchange, md2.EggFinWithdrawApplyData{
  34. Id: 1,
  35. Uid: 2,
  36. AdmId: 3,
  37. Amount: "10",
  38. RealAmount: "10",
  39. Fee: "4",
  40. Type: 1,
  41. WithdrawAccount: "3",
  42. WithdrawName: "2",
  43. Reason: 2,
  44. PaymentDate: "2",
  45. State: 2,
  46. WithdrawKind: 2,
  47. IsFirst: 2,
  48. Memo: "测试报错例子2",
  49. UpdateAt: "",
  50. CreateAt: "",
  51. }, md2.EggFinWithdrawApply)
  52. }