auth response and error codes imp

This commit is contained in:
2025-01-28 21:35:52 +03:00
parent 8550c2af71
commit a0b1b1bef9
16 changed files with 639 additions and 314 deletions

View File

@@ -0,0 +1,23 @@
from typing import Optional
from Services.Redis import RedisActions
from ApiLayers.AllConfigs.Redis.configs import RedisValidationKeysAction
class StaticValidationRetriever:
lang: str = "tr"
code: str = ""
def __init__(self, lang: str, code: str):
self.lang = lang
self.code = code
@property
def response(self) -> Optional[dict]:
language_model = RedisActions.get_json(
list_keys=[RedisValidationKeysAction.static_response_key, self.code, self.lang]
)
if language_model.status:
return language_model.first
return {"message": f"{self.code} -> Language model not found"}