mirror of
https://github.com/mskatoni/ni-mail.git
synced 2026-09-05 23:47:36 +08:00
feat: complete ni-mail rewrite with Graph API, IMAP, OTP extractor, Web UI and Docker deployment
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from app.db import db
|
||||
|
||||
class Account(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
email = db.Column(db.String(128), unique=True, nullable=False)
|
||||
method = db.Column(db.String(10), default="graph") # graph | imap
|
||||
client_id = db.Column(db.String(64))
|
||||
refresh_token = db.Column(db.Text)
|
||||
password = db.Column(db.String(128))
|
||||
created_at = db.Column(db.DateTime, default=db.func.now())
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
"email": self.email,
|
||||
"method": self.method,
|
||||
"client_id": self.client_id,
|
||||
"created_at": str(self.created_at) if self.created_at else None
|
||||
}
|
||||
Reference in New Issue
Block a user