ReadyController class

Введение

  1. Описание: Контроллер ReadyController предоставляет конечную точку API для проверки работоспособности системы.
  2. Маршруты: Обрабатывается GET-запрос по маршруту /ready.

Формат запроса

Необходимо передать secret=ADMIN_SECRET.

Валидация и преобразование данных

Основная логика

Контроллер проверяет работоспособность 4 сервисов: hasura, umbrella_partner, geo-service (geo-api), firebase.

Взаимодействие с микросервисами

  1. Hasura: вызов базового query запроса.
  2. Geo-service: получение районов по маршруту /Geo_Api/all-district-list.json.
  3. Umbrella: запрос по маршруту /Umbrella_Partner/couriers/available-products/pe-central.
  4. Firebase: запрос по маршруту /CLOUD_FUNCTION_URL/refreshToken.

Ответы сервера

  1. Система готова к использованию: Возвращается статус 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
           }
         ]
       }
      
  2. Сервис недоступен. Ожидаемый статус - 503 Service Unavailable.
Inheritance

Constructors

ReadyController()

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