types.go 1.3 KB

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