mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2026-07-28 05:00:38 +03:00
refactor: add type hints to function signatures across multiple files
This commit is contained in:
@@ -25,7 +25,7 @@ async def verify_jwt(request: Request, token: str) -> bool:
|
||||
|
||||
|
||||
class AuthBearer(HTTPBearer):
|
||||
def __init__(self, auto_error: bool = True):
|
||||
def __init__(self, auto_error: bool = True) -> None:
|
||||
super().__init__(auto_error=auto_error)
|
||||
|
||||
async def __call__(self, request: Request):
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import orjson
|
||||
|
||||
|
||||
class StreamLLMService:
|
||||
def __init__(self, base_url: str = "http://localhost:11434/v1"):
|
||||
def __init__(self, base_url: str = "http://localhost:11434/v1") -> None:
|
||||
self.base_url = base_url
|
||||
self.model = "llama3.2"
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class SMTPEmailService(metaclass=SingletonMetaNoArgs):
|
||||
)
|
||||
server: smtplib.SMTP = field(init=False) # Deferred initialization in post-init
|
||||
|
||||
def __attrs_post_init__(self):
|
||||
def __attrs_post_init__(self) -> None:
|
||||
"""
|
||||
Initializes the SMTP server connection after the object is created.
|
||||
|
||||
@@ -98,7 +98,7 @@ class SMTPEmailService(metaclass=SingletonMetaNoArgs):
|
||||
subject: str,
|
||||
body_text: str = "",
|
||||
body_html: str = None,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Sends an email to the specified recipients.
|
||||
|
||||
@@ -130,7 +130,7 @@ class SMTPEmailService(metaclass=SingletonMetaNoArgs):
|
||||
template: str,
|
||||
context: dict,
|
||||
sender: EmailStr,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Sends an email using a Jinja2 template.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user