蛋蛋星球RabbitMq消费项目
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

55 rindas
1.3 KiB

  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. }