125 lines
4.3 KiB
Python
125 lines
4.3 KiB
Python
from ApiLayers.AllConfigs import HostConfig
|
|
|
|
|
|
class WagRedis:
|
|
|
|
REDIS_HOST = HostConfig.MAIN_HOST
|
|
REDIS_PASSWORD: str = "commercial_redis_password"
|
|
REDIS_PORT: int = 11222
|
|
REDIS_DB: int = 0
|
|
|
|
@classmethod
|
|
def as_dict(cls):
|
|
return dict(
|
|
host=WagRedis.REDIS_HOST,
|
|
password=WagRedis.REDIS_PASSWORD,
|
|
port=WagRedis.REDIS_PORT,
|
|
db=WagRedis.REDIS_DB,
|
|
)
|
|
|
|
|
|
class RedisValidationKeys:
|
|
ENDPOINTS: str = "ENDPOINTS"
|
|
VALIDATIONS: str = "VALIDATIONS"
|
|
HEADERS: str = "HEADERS"
|
|
ERRORCODES: str = "ERRORCODES"
|
|
RESPONSES: str = "RESPONSES"
|
|
REQUESTS: str = "REQUESTS"
|
|
RESPONSE: str = "RESPONSE"
|
|
LANGUAGE_MODELS: str = "LANGUAGE_MODELS"
|
|
STATIC: str = "STATIC"
|
|
DYNAMIC: str = "DYNAMIC"
|
|
# REQUEST: str = "REQUEST"
|
|
# VALIDATION_USER: str = "VALIDATION_USER"
|
|
|
|
|
|
class RedisAuthKeys:
|
|
AUTH: str = "AUTH"
|
|
OCCUPANT: str = "OCCUPANT"
|
|
EMPLOYEE: str = "EMPLOYEE"
|
|
|
|
|
|
class RedisCategoryKeys:
|
|
REBUILD: str = "REBUILD"
|
|
ENDPOINT2CLASS: str = "ENDPOINT2CLASS"
|
|
CLUSTER_INDEX: str = "CLUSTER_INDEX"
|
|
CLUSTER_FUNCTION_CODES: str = "CLUSTER_FUNCTION_CODES"
|
|
METHOD_FUNCTION_CODES: str = "METHOD_FUNCTION_CODES"
|
|
MENU_FIRST_LAYER: str = "MENU_FIRST_LAYER"
|
|
PAGE_MAPPER: str = "PAGE_MAPPER"
|
|
MENU_MAPPER: str = "MENU_MAPPER"
|
|
|
|
|
|
class RedisCategoryPageInfoKeys:
|
|
"""
|
|
### /create?site=BuildingCluster, #/update?site=BuildingCluster, #/dashboard?site=BuildingCluster
|
|
PAGE_URL: /dashboard?site=BuildingCluster
|
|
PAGE_NAME: BuildingCluster
|
|
PAGE_INFO: {LANGUAGE_MODELS: "", ICON: "", URL: ""}
|
|
PAGE_MENU_INDEX: 1 # {build_living_space: "uuid4", LAYER: 1, MENU_INDEX: 1}
|
|
|
|
PAGE_MENU_COMPONENT: {..., lang: {"tr"}: {...}, lang: {"en"}: {...}}
|
|
PAGE_LANGUAGE: {{"tr"}: {...},{"en"}: {...}}
|
|
"""
|
|
|
|
PAGE_URL: str = "PAGE_URL"
|
|
PAGE_NAME: str = "PAGE_NAME"
|
|
PAGE_INFO: str = "PAGE_INFO"
|
|
PAGE_COMPONENT: str = "PAGE_COMPONENT"
|
|
PAGE_MENU_INDEX: str = "PAGE_MENU_INDEX"
|
|
PAGE_MENU_COMPONENT: str = "PAGE_MENU_COMPONENT"
|
|
PAGE_LANGUAGE: str = "PAGE_LANGUAGE"
|
|
|
|
|
|
class RedisCategoryPageInfoKeysAction:
|
|
"""
|
|
PAGE_MAPPER: {PAGE_URL: /dashboard?site=BuildingCluster, PAGE_NAME: BuildingCluster, PAGE_INFO: {LANGUAGE_MODELS: "", ICON: "", URL: ""}}
|
|
value : {RedisCategoryPageInfoKeys.PAGE_INFO}
|
|
MENU_MAPPER: {PAGE_MENU_INDEX: 1, PAGE_MENU_COMPONENT: {..., lang: {"tr"}: {...}, lang: {"en"}: {...}}}
|
|
value : {RedisCategoryPageInfoKeys.PAGE_INFO}
|
|
"""
|
|
|
|
page_index: str = (
|
|
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
|
)
|
|
|
|
page_mapper_key: str = (
|
|
f"{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}:{RedisCategoryPageInfoKeys.PAGE_URL}"
|
|
)
|
|
page_mapper_key: str = (
|
|
f"{page_mapper_key}:{RedisCategoryPageInfoKeys.PAGE_LANGUAGE}"
|
|
)
|
|
menu_mapper_key: str = (
|
|
f"{RedisCategoryPageInfoKeys.PAGE_URL}:{RedisCategoryPageInfoKeys.PAGE_MENU_INDEX}"
|
|
)
|
|
menu_mapper_key: str = (
|
|
f"{menu_mapper_key}:{RedisCategoryPageInfoKeys.PAGE_MENU_COMPONENT}"
|
|
)
|
|
|
|
|
|
class RedisValidationKeysAction:
|
|
# LANGUAGE_MODELS:DYNAMIC:VALIDATIONS:
|
|
dynamic_validation_key: str = (
|
|
f"{RedisValidationKeys.LANGUAGE_MODELS}:{RedisValidationKeys.DYNAMIC}:{RedisValidationKeys.VALIDATIONS}"
|
|
)
|
|
# LANGUAGE_MODELS:DYNAMIC:HEADERS:REQUEST
|
|
dynamic_header_request_key: str = (
|
|
f"{RedisValidationKeys.LANGUAGE_MODELS}:{RedisValidationKeys.DYNAMIC}:{RedisValidationKeys.HEADERS}:{RedisValidationKeys.REQUESTS}"
|
|
)
|
|
# LANGUAGE_MODELS:DYNAMIC:HEADERS:RESPONSE
|
|
dynamic_header_response_key: str = (
|
|
f"{RedisValidationKeys.LANGUAGE_MODELS}:{RedisValidationKeys.DYNAMIC}:{RedisValidationKeys.HEADERS}:{RedisValidationKeys.RESPONSES}"
|
|
)
|
|
# LANGUAGE_MODELS:STATIC:ERRORCODES:
|
|
static_error_code_key: str = (
|
|
f"{RedisValidationKeys.LANGUAGE_MODELS}:{RedisValidationKeys.STATIC}:{RedisValidationKeys.ERRORCODES}"
|
|
)
|
|
# LANGUAGE_MODELS:STATIC:RESPONSES:
|
|
static_response_key: str = (
|
|
f"{RedisValidationKeys.LANGUAGE_MODELS}:{RedisValidationKeys.STATIC}:{RedisValidationKeys.RESPONSES}"
|
|
)
|
|
# LANGUAGE_MODELS:STATIC:REQUESTS:
|
|
static_request_key: str = (
|
|
f"{RedisValidationKeys.LANGUAGE_MODELS}:{RedisValidationKeys.STATIC}:{RedisValidationKeys.REQUESTS}"
|
|
)
|