updated services api
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from fastapi import APIRouter
|
||||
from .events.router import event_endpoint_route
|
||||
from .services.router import services_endpoint_route
|
||||
from .services.router import services_route
|
||||
from .application.router import application_endpoint_route
|
||||
|
||||
def get_routes() -> list[APIRouter]:
|
||||
return [event_endpoint_route, application_endpoint_route, services_endpoint_route]
|
||||
return [event_endpoint_route, application_endpoint_route, services_route]
|
||||
|
||||
|
||||
def get_safe_endpoint_urls() -> list[tuple[str, str]]:
|
||||
|
||||
@@ -19,7 +19,7 @@ services_list = "ServicesList"
|
||||
description="List all services endpoint",
|
||||
operation_id=endpoints_index[services_list],
|
||||
)
|
||||
def services_list(data: PaginateOnly, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_list(data: PaginateOnly, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
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)
|
||||
@@ -34,7 +34,7 @@ services_create = "ServicesCreate"
|
||||
description="Create service endpoint",
|
||||
operation_id=endpoints_index[services_create],
|
||||
)
|
||||
def services_create(data, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_create(data: dict, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
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)
|
||||
@@ -49,7 +49,7 @@ services_update = "ServicesUpdate"
|
||||
description="Update service endpoint",
|
||||
operation_id=endpoints_index[services_update],
|
||||
)
|
||||
def services_update(uu_id: str, data, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_update(uu_id: str, data: dict, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
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)
|
||||
@@ -64,7 +64,7 @@ services_delete = "ServicesDelete"
|
||||
description="Delete service endpoint",
|
||||
operation_id=endpoints_index[services_delete],
|
||||
)
|
||||
def services_delete(uu_id: str, headers: CommonHeaders = Depends(CommonHeaders)):
|
||||
def services_delete(uu_id: str, headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
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)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy import func
|
||||
from schemas import AccountRecords
|
||||
from Schemas import AccountRecords
|
||||
|
||||
from endpoints.index import endpoints_index
|
||||
from events.event_endpoints.cluster import EventsEndpointRouterCluster
|
||||
|
||||
Reference in New Issue
Block a user