auth response and error codes imp
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user