events imports are checked
This commit is contained in:
54
service_app/routers/events/modules/router.py
Normal file
54
service_app/routers/events/modules/router.py
Normal file
@@ -0,0 +1,54 @@
|
||||
from fastapi.routing import APIRouter
|
||||
from fastapi.requests import Request
|
||||
|
||||
from api_validations.validations_request import (
|
||||
DepartmentsPydantic,
|
||||
PatchRecord,
|
||||
ListOptions,
|
||||
)
|
||||
|
||||
from api_services.redis.auth_actions.token import parse_token_object_to_dict
|
||||
|
||||
|
||||
modules_route = APIRouter(prefix="/modules", tags=["Modules"])
|
||||
modules_route.include_router(modules_route, include_in_schema=True)
|
||||
|
||||
|
||||
@modules_route.post(path="/list", summary="List Active/Delete/Confirm Modules")
|
||||
def modules_list(request: Request, list_options: ListOptions):
|
||||
from events.events_modules import ModulesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModulesEvents, "modules_list")
|
||||
return active_function(list_options=list_options, token_dict=token_dict)
|
||||
|
||||
|
||||
@modules_route.post(path="/create", summary="Create Modules with given auth levels")
|
||||
def modules_create(request: Request, data: DepartmentsPydantic):
|
||||
from events.events_modules import ModulesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModulesEvents, "modules_create")
|
||||
return active_function(data=data, token_dict=token_dict)
|
||||
|
||||
|
||||
@modules_route.post(
|
||||
path="/update/{module_uu_id}", summary="Update Modules with given auth levels"
|
||||
)
|
||||
def modules_update(request: Request, module_uu_id: str, data: DepartmentsPydantic):
|
||||
from events.events_modules import ModulesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModulesEvents, "modules_update")
|
||||
return active_function(data=data, module_uu_id=module_uu_id, token_dict=token_dict)
|
||||
|
||||
|
||||
@modules_route.patch(
|
||||
path="/patch/{module_uu_id}", summary="Patch Modules with given auth levels"
|
||||
)
|
||||
def modules_patch(request: Request, module_uu_id: str, data: PatchRecord):
|
||||
from events.events_modules import ModulesEvents
|
||||
|
||||
token_dict = parse_token_object_to_dict(request=request)
|
||||
active_function = getattr(ModulesEvents, "modules_patch")
|
||||
return active_function(data=data, token_dict=token_dict)
|
||||
Reference in New Issue
Block a user