common.go 451 B

12345678910111213141516171819202122232425262728
  1. package model
  2. import (
  3. "net"
  4. "server/dao"
  5. "sync"
  6. )
  7. var (
  8. InductanceTCP net.Listener
  9. ConnectionMap = make(map[string]net.Conn)
  10. Mutex sync.Mutex
  11. )
  12. type QueueData struct {
  13. Id string `json:"id"`
  14. Value []byte `json:"value"`
  15. }
  16. type DeviceRequest struct {
  17. Device dao.Device `json:"device"`
  18. State int `json:"state"`
  19. }
  20. type DevicesRequest struct {
  21. Devices []dao.Device `json:"devices"`
  22. State int `json:"state"`
  23. }