Exemplo n.º 1
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    return (endpoints.HealthEndpoint(
        config=config,
        context=context,
        uri='/',
        methods=('GET', 'POST'),
    ),
            endpoints.CreateEmployeeEndpoint(
                config,
                context,
                uri='/employee',
                methods=['POST'],
            ),
            endpoints.AuthEmployeeEndpoint(
                config,
                context,
                uri='/employee/auth',
                methods=['POST'],
            ),
            endpoints.EmployeeEndpoint(
                config,
                context,
                uri='/employee/<eid:int>',
                methods=['PATCH', 'DELETE'],
                auth_required=True,
            ),
            endpoints.AllEmployeeEndpoint(
                config,
                context,
                uri='/employee/all',
                methods=['GET'],
                auth_required=True,
            ))
Exemplo n.º 2
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    return (
        endpoints.CreateEmployeeEndpoint(
            config, context, uri='/user', methods=['POST'],
        ),
        endpoints.AuthEmployeeEndpoint(
            config, context, uri='/auth', methods=['POST'],
        ),
        endpoints.EmployeeEndpoint(
            config, context, uri='/user/<eid:int>', methods=['GET', 'PATCH', 'DELETE'], auth_required=True,
        ),
        endpoints.AllEmployeeEndpoint(
            config, context, uri='/user/all', methods=['GET'], auth_required=True,
        ),
        endpoints.CreateMessageEndpoint(
            config, context, uri='/msg', methods=['POST'], auth_required=True,
        ),
        endpoints.SendedMsgEndpoint(
            config, context, uri='/msg', methods=['GET'], auth_required=True,
        ),
        endpoints.MessageEndpoint(
            config, context, uri='/msg/<message_id:int>', methods=['PATCH', 'DELETE', 'GET'], auth_required=True
        )

    )
Exemplo n.º 3
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    return (
        endpoints.HealthEndpoint(config=config,
                                 context=context,
                                 uri='/',
                                 methods=('GET', 'POST')),
        endpoints.CreateEmployeeEndpoint(config,
                                         context,
                                         uri='/employee',
                                         methods=['POST']),
        endpoints.CreateUserEndpoint(config,
                                     context=context,
                                     uri='/user',
                                     methods=['POST']),
    )