add position to sim info
This commit is contained in:
+14
-2
@@ -1,16 +1,26 @@
|
||||
import datetime
|
||||
import time
|
||||
|
||||
|
||||
class SimInfoPojo:
|
||||
phone: str
|
||||
ccid: str
|
||||
update_at: int
|
||||
position: int
|
||||
|
||||
def __init__(self, phone: str, ccid: str):
|
||||
def __init__(self, phone: str, ccid: str, position, update_at: int = int(time.time())):
|
||||
self.phone = phone
|
||||
self.ccid = ccid
|
||||
self.update_at = update_at
|
||||
self.position = position
|
||||
|
||||
@staticmethod
|
||||
def from_firestore_dict(source):
|
||||
phone = source['phone']
|
||||
ccid = source['ccid']
|
||||
result = SimInfoPojo(phone=phone, ccid=ccid)
|
||||
update_at = source['update_at']
|
||||
position = source['position']
|
||||
result = SimInfoPojo(phone=phone, ccid=ccid, update_at=update_at, position=position)
|
||||
result.id = id
|
||||
return result
|
||||
|
||||
@@ -18,6 +28,8 @@ class SimInfoPojo:
|
||||
dest = {
|
||||
u'phone': self.phone,
|
||||
u'ccid': self.ccid,
|
||||
u'update_at': self.update_at,
|
||||
u'position': self.position,
|
||||
}
|
||||
|
||||
return dest
|
||||
|
||||
@@ -2,8 +2,6 @@ from dataclasses import dataclass
|
||||
|
||||
from gsmmodem import GsmModem
|
||||
|
||||
from pojo.contact_pojo import ContactPojo
|
||||
|
||||
|
||||
@dataclass
|
||||
class SerialModem():
|
||||
|
||||
Reference in New Issue
Block a user