NatsProduct.go 492 B

1234567891011121314151617181920212223
  1. package NatsServer
  2. import (
  3. "Cold_Api/controllers/lib"
  4. "github.com/beego/beego/v2/core/logs"
  5. "Cold_Api/models/Product"
  6. "github.com/vmihailenco/msgpack/v5"
  7. )
  8. func Up_ProductUpgrade(T_sn, T_version, T_file, T_mqttid string) {
  9. t_Req := Product.ProductUpgrade_T{
  10. T_sn: T_sn,
  11. T_version: T_version,
  12. T_file: T_file,
  13. }
  14. b, _ := msgpack.Marshal(&t_Req)
  15. err := lib.Nats.Publish("Up_ProductUpgrade"+T_mqttid, b)
  16. if err != nil {
  17. logs.Info("Nats =>", lib.FuncName(), err)
  18. }
  19. }