types.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. VirtualPlcItem struct {
  45. ProjectId int `json:"ProjectId"`
  46. IsVirtual int `json:"is_virtual"`
  47. PageSize int `json:"pageSize"`
  48. }
  49. VirtualPlc struct {
  50. ItemName string `json:"ItemName"`
  51. Expression string `json:"Expression"`
  52. }
  53. VirtualPlcPage struct {
  54. List []*VirtualPlc `json:"list"`
  55. }
  56. VirtualPlcItemResp struct {
  57. Code int `json:"code"`
  58. Data *VirtualPlcPage `json:"data"`
  59. }
  60. )