types.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package envitem
  2. import "github.com/go-redis/redis/v8"
  3. type (
  4. Options struct {
  5. GtServerIp string
  6. Cache *redis.Client
  7. }
  8. EnvItem struct {
  9. ProjectId int64 `json:"project_id"`
  10. DeviceCode string `json:"device_code"`
  11. PlcDeviceId string `json:"plc_device_id"`
  12. Item string `json:"item"`
  13. DefaultVal interface{} `json:"default_val"`
  14. Value interface{} `json:"value"`
  15. Htime string `json:"htime"`
  16. }
  17. MultiEnvItem map[string]*EnvItem
  18. ItemValueResp struct {
  19. Alias string `json:"alias"`
  20. DataAddress string `json:"dataAddress"`
  21. DataType string `json:"datatype"`
  22. DevName string `json:"devName"`
  23. DevID string `json:"devid"`
  24. HTime string `json:"htime"`
  25. ItemID string `json:"itemid"`
  26. ItemName string `json:"itemname"`
  27. Quality string `json:"quality"`
  28. ReadOnly bool `json:"readOnly"`
  29. SpecificType string `json:"specificType"`
  30. Val string `json:"val"`
  31. }
  32. ItemValueResps struct {
  33. Code int `json:"code"`
  34. Data []*ItemValueResp `json:"data"`
  35. }
  36. ItemValueReq struct {
  37. DeviceId string `json:"deviceId"`
  38. DeviceItems string `json:"deviceItems"`
  39. ProjectId int64 `json:"project_id"`
  40. }
  41. )