UpdateDistrictsAndProvincesController class
Введение
- Описание: Контроллер
UpdateDistrictsAndProvincesControllerпредоставляет конечную точку API для обновления районов и провинций в хасуре. - Маршруты: Обрабатывается GET-запрос по маршруту
/districts/update-from-crm.
Формат запроса
Валидация и преобразование данных
Основная логика
Контроллер запрашивает данные по районам из GEO_API, а так же из Hasura. Производится
разбиение по 3 группам: provinces, updatedDistricts(новые районы), deletedDistrictsIds(районы удаленные в гео-сервисе).
После данные обновляются в Hasura.
Взаимодействие с микросервисами
- Hasura: Получение и обновление районов.
- GEO_API: Получение списка районов.
Ответы сервера
- Успешное обновление: Возвращается статус
200 OKс текстом:UpdateDistrictsAndProvincesController: CRM districts synced successfully
- Внутренние ошибки. Ожидаемый статус -
500 internalServerError.
- Inheritance
-
- Object
- Controller
- UpdateDistrictsAndProvincesController
Constructors
Properties
- endpoint ↔ String
-
getter/setter pairinherited
- geoRepository → GeoRepository
-
final
- 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
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