蛋蛋星球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.
 
 
 
 
 
 

43 lines
1.0 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 TestEggEnergyTeamAssistanceConsume(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.EggEnergyExchange, md2.EggEnergyTeamAssistanceReq{
  34. AssistanceUid: 17,
  35. Uid: 2,
  36. AssistanceValue: 100,
  37. SignStart: "2024-12-20 08:00:00",
  38. SignEnd: "2024-12-21 08:00:00",
  39. }, md2.EggEnergyTeamAssistance)
  40. }