UserCreateController class
Введение
- Описание: Контроллер
UserCreateControllerотвечает за нового юзера в hasura и firebase. - Маршруты: Обрабатываются POST-запрос по маршруту
/user/create.
Формат запроса
Тело запроса: JSON-объект, содержащий идентификатор пользователя.
{
"input": {
"user": {
"name": "Mikhail",
"email": "first@gmail.com",
"roles": ["driver"],
"departamentId": 1,
"metadata": {
"ce": "string?",
"dni": "string?",
"fullname": "string?",
"ptp": "string?"
}
}
}
}
Валидация и преобразование данных
Основная логика
- Создаём юзера в Hasura.
- Добавляет metadata юзеру в Hasura.
- Создаёт юзера в Firebase.
Взаимодействие с микросервисами
- Hasura: создание юзера и добавление metadata.
- Firebase: создание юзера в firebase.
Ответы сервера
- Успешное создание юзера: Ожидаемый статус -
200 OK. - Ошибка создания: Ожидаемый статус -
400 badRequest.
- Inheritance
-
- Object
- Controller
- UserCreateController
Constructors
Properties
- endpoint ↔ String
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- request ↔ Request
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userRepository → UserRepository
-
final
Methods
-
call(
Request request) → FutureOr< Response> -
inherited
-
handler(
) → FutureOr< Response> -
Must be implemented
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestAsJson(
) → Future -
Reads request value and parse as json
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited