Revert "Merge branch 'fetch-device-info' into 'main'"
This reverts merge request !10
This commit is contained in:
@@ -5,10 +5,21 @@ import "github.com/jinzhu/gorm"
|
||||
type Company struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
Password string
|
||||
Email string
|
||||
Avatar string
|
||||
Users []User
|
||||
Devices []Device
|
||||
}
|
||||
|
||||
// func FetchCompanies(companies *[]Company) (err error) {
|
||||
// db := gorm.GetDb()
|
||||
|
||||
// if err = db.Find(companies).Error; err != nil {
|
||||
// return err
|
||||
// }
|
||||
// return nil
|
||||
// }
|
||||
|
||||
func (Company) Update() (bool, error) {
|
||||
return false, nil
|
||||
|
||||
@@ -15,9 +15,6 @@ type Contract struct {
|
||||
ContractInfos []ContractInfo
|
||||
}
|
||||
|
||||
const ContractStatusActive = "active"
|
||||
const ContractStatusPending = "pending"
|
||||
|
||||
func (Contract) Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
type Device struct {
|
||||
gorm.Model
|
||||
DeviceID string `json:"deviceId"`
|
||||
DeviceName string
|
||||
IMEI string `json:"imei"`
|
||||
IMSI string `json:"imsi"`
|
||||
|
||||
@@ -18,10 +18,6 @@ type SensorData struct {
|
||||
WifiLoc Location `json:"wifi_location"`
|
||||
CellLoc Location `json:"cell_location"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
// Used to parse incoming json data
|
||||
AccInfo AccelerometerInfo `json:"accelerometerInfo"`
|
||||
// Used to store coordinates of accelerometer to DB
|
||||
AccelerometerInfo
|
||||
}
|
||||
|
||||
type DeviceInfo struct {
|
||||
@@ -29,34 +25,8 @@ type DeviceInfo struct {
|
||||
RawJSON string `json:"raw_json" gorm:"type:json"`
|
||||
SensorData
|
||||
DeviceID uint
|
||||
ExternalDeviceID string `json:"deviceId"`
|
||||
}
|
||||
|
||||
|
||||
type AccelerometerInfo struct {
|
||||
X int64
|
||||
Y int64
|
||||
Z int64
|
||||
}
|
||||
|
||||
type GeoJSONFeatureCollection struct {
|
||||
Type string `json:"type"`
|
||||
Features []GeoJSONFeature `json:"features"`
|
||||
}
|
||||
|
||||
type GeoJSONFeature struct {
|
||||
Type string `json:"type"`
|
||||
Geometry GeoJSONGeometry `json:"geometry"`
|
||||
DeviceInfo *DeviceInfo `json:",omitempty"`
|
||||
Properties map[string]interface{} `json:"properties"`
|
||||
}
|
||||
|
||||
type GeoJSONGeometry struct {
|
||||
Type string `json:"type"`
|
||||
Coordinates []float64 `json:"coordinates"`
|
||||
}
|
||||
|
||||
|
||||
func (DeviceInfo) Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
@@ -66,6 +36,3 @@ func (DeviceInfo) Create() (bool, error) {
|
||||
func (DeviceInfo) Delete() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user