event and service sendpoints added

This commit is contained in:
2025-04-30 18:19:31 +03:00
parent 36e63960f8
commit e815251123
24 changed files with 441 additions and 79 deletions

View File

@@ -9,7 +9,14 @@ def get_routes() -> list[APIRouter]:
from .spaces.route import spaces_route
from .type.route import build_types_route
return [building_route, area_route, sites_route, parts_route, spaces_route, build_types_route]
return [
building_route,
area_route,
sites_route,
parts_route,
spaces_route,
build_types_route,
]
def get_safe_endpoint_urls() -> list[tuple[str, str]]:

View File

@@ -25,7 +25,9 @@ def spaces_list_route(
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
event_founder_dict = dict(endpoint_code=headers.operation_id, token=token_object)
event_key = TokenProvider.retrieve_event_codes(**event_founder_dict)
FoundCluster = BuildLivingSpaceRouterCluster.get_event_cluster("BuildLivingSpaceList")
FoundCluster = BuildLivingSpaceRouterCluster.get_event_cluster(
"BuildLivingSpaceList"
)
event_cluster_matched = FoundCluster.match_event(event_key=event_key)
return event_cluster_matched.event_callable(data=data)
@@ -45,7 +47,9 @@ def spaces_create_route(
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
event_founder_dict = dict(endpoint_code=headers.operation_id, token=token_object)
event_key = TokenProvider.retrieve_event_codes(**event_founder_dict)
FoundCluster = BuildLivingSpaceRouterCluster.get_event_cluster("BuildLivingSpaceCreate")
FoundCluster = BuildLivingSpaceRouterCluster.get_event_cluster(
"BuildLivingSpaceCreate"
)
event_cluster_matched = FoundCluster.match_event(event_key=event_key)
return event_cluster_matched.event_callable(data=data)
@@ -65,6 +69,8 @@ def spaces_update_route(
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
event_founder_dict = dict(endpoint_code=headers.operation_id, token=token_object)
event_key = TokenProvider.retrieve_event_codes(**event_founder_dict)
FoundCluster = BuildLivingSpaceRouterCluster.get_event_cluster("BuildLivingSpaceUpdate")
FoundCluster = BuildLivingSpaceRouterCluster.get_event_cluster(
"BuildLivingSpaceUpdate"
)
event_cluster_matched = FoundCluster.match_event(event_key=event_key)
return event_cluster_matched.event_callable(data=data)