read mail after request
This commit is contained in:
@@ -39,13 +39,15 @@ class ContactPojo:
|
||||
|
||||
@staticmethod
|
||||
def from_firestore_dict(source):
|
||||
ccid = source['ccid']
|
||||
phone = source['phone']
|
||||
position = source['position']
|
||||
passport = source['passport']
|
||||
email = source['mail']
|
||||
last_name = source['last_name']
|
||||
first_name = source['first_name']
|
||||
result = ContactPojo(ccid=ccid, phone_number=phone, passport_number=passport, position=position, mail=email,
|
||||
ip_country = "FR"
|
||||
if source.get('ip_country'):
|
||||
ip_country = source['ip_country']
|
||||
result = ContactPojo(phone_number=phone, passport_number=passport, mail=email,
|
||||
last_name=last_name, first_name=first_name)
|
||||
result.ip_country = ip_country
|
||||
return result
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
class MailAddress:
|
||||
def __init__(self, mail, password):
|
||||
self.mail = mail
|
||||
self.password = password
|
||||
|
||||
def __repr__(self):
|
||||
return "邮箱:{}, 密码:{}".format(self.mail, self.password)
|
||||
|
||||
def to_firestore_dict(self):
|
||||
dest = {
|
||||
u'mail': self.mail,
|
||||
u'password': self.password
|
||||
}
|
||||
return dest
|
||||
|
||||
@staticmethod
|
||||
def from_firestore_dict(source):
|
||||
password = source['password']
|
||||
mail = source['mail']
|
||||
return MailAddress(mail=mail, password=password)
|
||||
|
||||
|
||||
class MailPojo:
|
||||
from_address: str
|
||||
to_address: str
|
||||
body: str
|
||||
subject: str
|
||||
mail_address: str = ""
|
||||
isImapClient = False
|
||||
|
||||
def __init__(self, from_address, body, subject):
|
||||
self.body = body
|
||||
self.subject = subject
|
||||
self.from_address = from_address
|
||||
self.isImapClient = False
|
||||
self.to_address = ""
|
||||
Reference in New Issue
Block a user