Esempio n. 1
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    return (endpoints.CreateUserEndpoint(
        config,
        context,
        uri='/user',
        methods=['POST'],
    ),
            endpoints.AuthUserEndpoint(
                config,
                context,
                uri='/auth',
                methods=['POST'],
            ),
            endpoints.GetDataUserEndpoint(
                config,
                context,
                uri='/user/<rid:int>',
                methods=['GET', 'PATCH'],
                auth_required=True,
            ),
            endpoints.CreateMessageEndpoint(
                config,
                context,
                uri='/msg',
                methods=['POST', 'GET'],
                auth_required=True,
            ),
            endpoints.ChangesMessageEndpoint(
                config,
                context,
                uri='/msg/<mid:int>',
                methods=['PATCH', 'DELETE', 'GET'],
                auth_required=True,
            ))
Esempio n. 2
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    return (endpoints.HealthEndpoint(
        config=config,
        context=context,
        uri='/',
        methods=('GET', 'POST'),
    ),
            endpoints.CreateUserEndpoint(
                config,
                context,
                uri='/user',
                methods=['POST'],
            ),
            endpoints.AuthUserEndpoint(
                config,
                context,
                uri='/auth',
                methods=['POST'],
            ),
            endpoints.UserEndpoint(
                config,
                context,
                uri='/user/<uid:int>',
                methods=['GET', 'PATCH', 'DELETE'],
                auth_required=True,
            ),
            endpoints.AllUserEndpoint(
                config,
                context,
                uri='/user/all',
                methods=['GET'],
                auth_required=True,
            ),
            endpoints.CreateMessageEndpoint(
                config,
                context,
                uri='msg',
                methods=['POST'],
                auth_required=True,
            ),
            endpoints.AllMessagesEndpoint(
                config,
                context,
                uri='msg',
                methods=['GET'],
                auth_required=True,
            ),
            endpoints.MessageEndpoint(
                config,
                context,
                uri='msg/<message_id:int>',
                methods=['GET', 'PATCH', 'DELETE'],
                auth_required=True,
            ))
Esempio n. 3
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    return (endpoints.HelloEndpoint(config=config,
                                    context=context,
                                    uri='/',
                                    methods=('GET', 'POST')),
            endpoints.CreateUserEndpoint(config,
                                         context,
                                         uri='/user',
                                         methods=['POST']),
            endpoints.AuthUserEndpoint(config,
                                       context,
                                       uri='/user/auth',
                                       methods=['POST']),
            endpoints.ModifyUserEndpoint(config,
                                         context,
                                         uri='/user/<uid:int>',
                                         methods=['PATCH', 'DELETE'],
                                         auth_required=True),
            endpoints.AllUserEndpoint(config,
                                      context,
                                      uri='/user/all',
                                      methods=['GET']),
            endpoints.OneUserEndpoint(config,
                                      context,
                                      uri='/user/<uid:int>',
                                      methods=['GET'],
                                      auth_required=True),
            endpoints.CreateMessageEndpoint(config,
                                            context,
                                            uri='/msg',
                                            methods=['POST'],
                                            auth_required=True),
            endpoints.GetMessagesEndpoint(config,
                                          context,
                                          uri='/msg',
                                          methods=['GET'],
                                          auth_required=True),
            endpoints.ModifyMessageEndpoint(config,
                                            context,
                                            uri='/msg/<message_id:int>',
                                            methods=['PATCH', 'DELETE'],
                                            auth_required=True),
            endpoints.OneMessageEndpoint(config,
                                         context,
                                         uri='/msg/<message_id:int>',
                                         methods=['GET'],
                                         auth_required=True),
            endpoints.DialogEndpoint(config,
                                     context,
                                     uri='/msg/<uid:int>/<rid:int>',
                                     methods=['GET'],
                                     auth_required=True))
Esempio n. 4
0
def get_routes(config: ApplicationConfig, context: Context):
    return (
        endpoints.CreateUserEndpoint(
            config=config, context=context, uri='/user', methods=['POST'],
        ),
        endpoints.AuthUserEndpoint(
            config=config, context=context, uri='/auth', methods=['POST'],
        ),
        endpoints.MessagesEndpoint(
            config=config, context=context, uri='/msg', methods=['GET', 'POST'], auth_required=True
        ),
        endpoints.UserEndpoint(
            config=config, context=context, uri='/user/<uid:int>', methods=['GET'], auth_required=True,
        ),
        endpoints.EditUserEndpoint(
            config=config, context=context, uri='/user/edit', methods=['PATCH'], auth_required=True,
        ),
        endpoints.MessageEndpoint(
            config=config, context=context, uri='msg/<mid:int>', methods=['GET', 'PATCH', 'DELETE'], auth_required=True
        ),
    )
Esempio n. 5
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    """
    Описание всех маршрутов приложения
    """
    return (
        endpoints.HealthEndpoint(
            config=config, context=context, uri='/', methods=('GET', 'POST'),
        ),
        endpoints.CreateUserEndpoint(
            config, context, uri='/user', methods=['POST'],
        ),
        endpoints.AuthUserEndpoint(
            config, context, uri='/auth', methods=['POST'],
        ),
        endpoints.UserEndpoint(
            config, context, uri='/user/<user_id:int>', methods=['GET', 'PATCH'], auth_required=True,
        ),
        endpoints.MessageEndpoint(
            config, context, uri='/msg', methods=['GET', 'POST'], auth_required=True,
        ),
        endpoints.SingleMessageEndpoint(
            config, context, uri='/msg/<message_id:int>', methods=['GET', 'PATCH', 'DELETE'], auth_required=True,
        ),
    )
def get_routes(config: ApplicationConfig, context: Context) -> tuple:
    return (
        endpoints.HealthEndpoint(
            config=config, context=context, uri='/', methods=['GET', 'POST']
        ),
        endpoints.CreateUserEndpoint(
            config=config, context=context, uri='/user', methods=['POST']
        ),
        endpoints.AuthUserEndpoint(
            config, context, uri='/auth', methods=['POST']
        ),
        endpoints.UserEndpoint(
            config, context, uri='/user/<uid:int>', methods=('GET', 'PATCH'),
            auth_required=True
        ),
        endpoints.UserEndpoint(
            config, context, uri='/user/<ulogin:string>', methods=('GET', 'PATCH'),
            auth_required=True
        ),
        endpoints.MessagesEndpoint(
            config=config, context=context, uri='/msg', methods=('GET', 'POST'),
            auth_required=True
        ),
        endpoints.MessageEndpoint(
            config=config, context=context, uri='/msg/<message_id:int>', methods=('GET', 'PATCH', 'DELETE'),
            auth_required=True
        ),
        endpoints.FilesEndpoint(
            config=config, context=context, uri='/files/<file_id:int>', methods=['GET'],
            auth_required=True
        ),
        endpoints.FilesEndpoint(
            config=config, context=context, uri='/files', methods=['POST'],
            auth_required=True
        ),
    )
Esempio n. 7
0
def get_routes(config: ApplicationConfig, context: Context) -> Tuple:
    return (
        endpoints.CreateUserEndpoint(
            config,
            context,
            uri='/user',
            methods=['POST'],
        ),
        endpoints.AuthUserEndpoint(
            config,
            context,
            uri='/auth',
            methods=['POST'],
        ),
        endpoints.UserEndpoint(
            config,
            context,
            uri='/user/<uid:int>',
            methods=['GET', 'PATCH', 'DELETE'],
            auth_required=True,
        ),
        endpoints.CreateMessageEndpoint(
            config,
            context,
            uri='/msg',
            methods=['POST'],
            auth_required=True,
        ),
        endpoints.AllMessageEndpoint(
            config,
            context,
            uri='/msg',
            methods=['GET'],
            auth_required=True,
        ),
        endpoints.AllInboxMessageEndpoint(
            config,
            context,
            uri='/msg/inbox',
            methods=['GET'],
            auth_required=True,
        ),
        endpoints.AllSentMessageEndpoint(
            config,
            context,
            uri='/msg/sent',
            methods=['GET'],
            auth_required=True,
        ),
        endpoints.MessageEndpoint(
            config,
            context,
            uri='msg/<mid:int>',
            methods=['GET', 'PATCH', 'DELETE'],
            auth_required=True,
        ),
        endpoints.AllDeletedMessagesEndpoint(
            config,
            context,
            uri='msg/trash',
            methods=['GET'],
            auth_required=True,
        ),
        endpoints.RecoveryMessageEndpoint(
            config,
            context,
            uri='msg/trash/<mid:int>',
            methods=['PATCH'],
            auth_required=True,
        ),
    )