20 lines
626 B
Python
20 lines
626 B
Python
from actions.dynamic_import.service_factory import ServiceFactory
|
|
from interfaces.service_protocols import ServiceProtocolsInterface
|
|
|
|
|
|
class TAtoController:
|
|
|
|
def __init__(self):
|
|
|
|
# Configura o escopo deste controller
|
|
self.factory = ServiceFactory(package="servicos.balcao", table="t_ato")
|
|
|
|
def index(self, schema):
|
|
|
|
# Instânciamento da classe
|
|
service = self.factory.make("TAtoIndexService", ServiceProtocolsInterface)
|
|
|
|
# O VS Code sabe que .execute() existe por causa do IService!
|
|
result = service.execute(schema)
|
|
|
|
return {"message": "Sucesso", "data": result}
|