Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
33
pkg/common/car_state_towman.go
Normal file
33
pkg/common/car_state_towman.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package common
|
||||
|
||||
type TowmanDigitalTwin struct {
|
||||
Online bool `json:"online"`
|
||||
Location *Location `json:"location"`
|
||||
Gear *Gear `json:"gear"`
|
||||
Charging *bool `json:"charging"`
|
||||
}
|
||||
|
||||
func (c *TowmanDigitalTwin) GetLocation() *Location {
|
||||
if c.Location == nil {
|
||||
c.Location = &Location{}
|
||||
}
|
||||
|
||||
return c.Location
|
||||
}
|
||||
|
||||
func (c *TowmanDigitalTwin) GetGear() *Gear {
|
||||
if c.Gear == nil {
|
||||
c.Gear = &Gear{}
|
||||
}
|
||||
|
||||
return c.Gear
|
||||
}
|
||||
|
||||
func (c *TowmanDigitalTwin) GetCharging() *bool {
|
||||
if c.Charging == nil {
|
||||
temp := false
|
||||
c.Charging = &temp
|
||||
}
|
||||
|
||||
return c.Charging
|
||||
}
|
||||
Reference in New Issue
Block a user