TriggerUserBannedController class
Введение
- Описание: Контроллер
TriggerUserBannedControllerпредоставляет конечную точку API для удаления районов у водителя. - Маршруты: Обрабатывается POST-запрос по маршруту
/trigger/user_banned.
Формат запроса
{
"event": {
"data": {
"new": {
"id": "user_id",
"blocked": "true"
}
}
}
}
Валидация и преобразование данных
Основная логика
При вызове данного триггера у водителя удаляются все связи с районами.
Взаимодействие с микросервисами
- Hasura: отвязка районов от водителя.
Ответы сервера
- Успешная блокировка: Возвращается статус
200 OK{ 'TriggerUserBannedController success: user $userId was deleted from driver_districts' } - Ошибки обработки:
- Попытка блокировки юзера с
blocked=false. Ожидаемый статус -400 badRequest. - Внутренние ошибки. Ожидаемый статус -
500 internalServerError.
- Попытка блокировки юзера с
- Inheritance
-
- Object
- Controller
- TriggerUserBannedController
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(
) → Future< 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