ReadyController class
Введение
- Описание: Контроллер
ReadyControllerпредоставляет конечную точку API для проверки работоспособности системы. - Маршруты: Обрабатывается GET-запрос по маршруту
/ready.
Формат запроса
Необходимо передать secret=ADMIN_SECRET.
Валидация и преобразование данных
Основная логика
Контроллер проверяет работоспособность 4 сервисов: hasura, umbrella_partner, geo-service (geo-api), firebase.
Взаимодействие с микросервисами
- Hasura: вызов базового query запроса.
- Geo-service: получение районов по маршруту /Geo_Api/all-district-list.json.
- Umbrella: запрос по маршруту /Umbrella_Partner/couriers/available-products/pe-central.
- Firebase: запрос по маршруту /CLOUD_FUNCTION_URL/refreshToken.
Ответы сервера
- Система готова к использованию: Возвращается статус
200 OK{ "status":"ok", "services": [ { "name": "Read/Hasura (Simple Aggregation Check)", "ready":true }, { "name": "Geo API + Write/Hasura (District And Province Sync)", "ready":true }, { "name": "Umbrella (Available Products PE)", "ready":true }, { "name": "Firebase Cloud Functions (Refresh User Token)", "ready":true } ] } - Сервис недоступен. Ожидаемый статус -
503 Service Unavailable.
- Inheritance
-
- Object
- Controller
- ReadyController
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
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