types.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. FetchMultiItem bool
  9. }
  10. EnvItem struct {
  11. ProjectId int64 `json:"project_id"`
  12. DeviceCode string `json:"device_code"`
  13. PlcDeviceId string `json:"plc_device_id"`
  14. Item string `json:"item"`
  15. DefaultVal interface{} `json:"default_val"`
  16. Value interface{} `json:"value"`
  17. Htime string `json:"htime"`
  18. }
  19. MultiEnvItem map[string]*EnvItem
  20. ItemValueResp struct {
  21. Alias string `json:"alias"`
  22. DataAddress string `json:"dataAddress"`
  23. DataType string `json:"datatype"`
  24. DevName string `json:"devName"`
  25. DevID string `json:"devid"`
  26. HTime string `json:"htime"`
  27. ItemID string `json:"itemid"`
  28. ItemName string `json:"itemname"`
  29. Quality string `json:"quality"`
  30. ReadOnly bool `json:"readOnly"`
  31. SpecificType string `json:"specificType"`
  32. Val string `json:"val"`
  33. }
  34. ItemValueResps struct {
  35. Code int `json:"code"`
  36. Data []*ItemValueResp `json:"data"`
  37. }
  38. ItemValueReq struct {
  39. DeviceId string `json:"deviceId"`
  40. DeviceItems string `json:"deviceItems"`
  41. ProjectId int64 `json:"project_id"`
  42. }
  43. )