chore: initial mobile api
This commit is contained in:
parent
d5d8bc1f33
commit
2ff422b262
|
@ -34,3 +34,9 @@ class DeviceInfoMobileSerializer(serializers.ModelSerializer):
|
||||||
def get_status(self, obj) -> int:
|
def get_status(self, obj) -> int:
|
||||||
return obj.online
|
return obj.online
|
||||||
|
|
||||||
|
def get_coordinate(self, obj):
|
||||||
|
if self.cur_device:
|
||||||
|
lon, lat = [self.cur_device.longitude, self.cur_device.latitude]
|
||||||
|
if lon and lat:
|
||||||
|
return [lon, lat]
|
||||||
|
return None
|
||||||
|
|
Loading…
Reference in New Issue