hikvision.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. package model
  2. import "gorm.io/gorm"
  3. type Hikvision struct {
  4. gorm.Model
  5. }
  6. type Monitor struct {
  7. Id int `json:"Id"`
  8. Name string `json:"Name"`
  9. }
  10. type RealTimeInspection struct {
  11. Id int `json:"Id"`
  12. Name string `json:"Name"` //名称
  13. Location string `json:"Location"` //位置
  14. Event string `json:"Event"` //事件-列3
  15. Date string `json:"Date"`
  16. }
  17. type Device struct {
  18. Id int `json:"Id"`
  19. Name string `json:"Name"` //名称
  20. State int `json:"State"` //状态
  21. Date string `json:"Date"` //事件-列3
  22. }
  23. type Visitor struct {
  24. Id int `json:"Id"`
  25. Name string `json:"Name"` //名称
  26. State int `json:"State"` //状态
  27. Phone string `json:"Phone"` //电话
  28. Location string `json:"Location"` //位置
  29. Date string `json:"Date"` //时间
  30. }
  31. type AlarmList struct {
  32. Id int `json:"Id"`
  33. Name string `json:"Name"` //名称
  34. AlarmContent string `json:"AlarmContent"` //告警内容
  35. Location string `json:"Location"` //位置
  36. State int `json:"State"` //状态
  37. Date string `json:"Date"` //时间
  38. }
  39. type Door struct {
  40. Name string `json:"name"`
  41. RegionIndexCodes []string `json:"regionIndexCodes"`
  42. IsSubRegion bool `json:"isSubRegion"`
  43. PageNo int `json:"pageNo"`
  44. PageSize int `json:"pageSize"`
  45. AuthCodes []string `json:"authCodes"`
  46. Expressions []struct {
  47. Key string `json:"key"`
  48. Operator int `json:"operator"`
  49. Values []string `json:"values"`
  50. } `json:"expressions"`
  51. OrderBy string `json:"orderBy"`
  52. OrderType string `json:"orderType"`
  53. }
  54. type DoorResp struct {
  55. Code string `json:"code"`
  56. Msg string `json:"msg"`
  57. Data struct {
  58. Total int `json:"total"`
  59. PageNo int `json:"pageNo"`
  60. PageSize int `json:"pageSize"`
  61. List []DoorList `json:"list"`
  62. } `json:"data"`
  63. }
  64. type DoorList struct {
  65. IndexCode string `json:"indexCode"`
  66. ResourceType string `json:"resourceType"`
  67. Name string `json:"name"`
  68. DoorNo string `json:"doorNo"`
  69. ChannelNo string `json:"channelNo"`
  70. ParentIndexCode string `json:"parentIndexCode"`
  71. ControlOneId string `json:"controlOneId"`
  72. ControlTwoId string `json:"controlTwoId"`
  73. ReaderInId string `json:"readerInId"`
  74. ReaderOutId string `json:"readerOutId"`
  75. DoorSerial int `json:"doorSerial"`
  76. TreatyType string `json:"treatyType"`
  77. RegionIndexCode string `json:"regionIndexCode"`
  78. RegionPath string `json:"regionPath"`
  79. CreateTime string `json:"createTime"`
  80. UpdateTime string `json:"updateTime"`
  81. Description string `json:"description"`
  82. ChannelType string `json:"channelType"`
  83. RegionName string `json:"regionName"`
  84. RegionPathName string `json:"regionPathName"`
  85. InstallLocation string `json:"installLocation"`
  86. }
  87. type Response struct {
  88. RequestId string `protobuf:"bytes,1,opt,name=requestId,proto3" json:"requestId,omitempty"`
  89. Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
  90. Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
  91. Data any `json:"data"`
  92. }
  93. type DoControl struct {
  94. Code string `json:"code"`
  95. Msg string `json:"msg"`
  96. Data []DoControlData `json:"data"`
  97. }
  98. type DoControlData struct {
  99. DoorIndexCode string `json:"doorIndexCode"`
  100. ControlResultCode int `json:"controlResultCode"`
  101. ControlResultDesc string `json:"controlResultDesc"`
  102. }
  103. func (m *Hikvision) TableName() string {
  104. return "hikvision"
  105. }