from flask import Blueprint
from app.di_container import Container
from app.controllers import UserController
from dependency_injector.wiring import inject, Provide

user_blueprint = Blueprint("user", __name__)


@user_blueprint.route("/users", methods=["GET"])
@inject
def get_users(user_controller: UserController = Provide[Container.user_controller]):
    return user_controller.get_users()


@user_blueprint.route("/register", methods=["POST"])
@inject
def register(user_controller: UserController = Provide[Container.user_controller]):
    return user_controller.register()
