Files
appointment_request/models/mail_pojo.py
T
2024-03-21 14:55:17 +01:00

37 lines
903 B
Python

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 = ""