/
Sensor.go
52 lines (47 loc) · 1.67 KB
/
Sensor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package model
import (
"gopkg.in/mgo.v2/bson"
"time"
)
type (
Sensor struct {
SensorId string `json:"sensorid,omitempty"`
OwnerId string `json:"ownerid"`
SensorName string `json:"sensorname"`
SensorDesc string `json:"sensordesc"`
SensorType string `json:"sensortype"`
IsShared bool `json:"isshared"`
IsEnabled bool `json:"isenabled,omitempty"`
IsActivated bool `json:"isactivated,omitempty"`
RegisterTime time.Time `json:"created,omitempty"`
Latitude string `json:"latitude,omitempty"`
Longitude string `json:"longitude,omitempty"`
}
SensorAuthenticate struct {
OwnerId string `json:"ownerid"`
SensorName string `json:"sensorname"`
Password string `json:"password"`
}
SensorData struct {
SensorId bson.ObjectId `json:"id" bson:"_id,omitempty"`
SensorName string `json:"sensorname"`
SensorData string `json:"sensordata"`
Location struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
} `json:"location"`
Time time.Time `json:"created,omitempty"`
}
VirtSensor struct {
VirtSensorId string `json:"virtsensorid,omitempty"`
VirtSensorName string `json:"virtsensorname"`
VirtSensorUserId string `json:"virtsensoruserid"`
PhysicalSensorName string `json:"sensorname"`
ProjectId string `json:"projectid"`
IsEnabled bool `json:"isenabled,omitempty"`
DataFreqinSec int `json:"datafreqinsec"`
UsageCounterinMins int `json:"usagecounterinmins,omitempty"`
RegisterTime time.Time `json:"created,omitempty"`
Status int `json:"status"`
}
)