SetCoordsController class
Введение
- Описание: Контроллер
SetCoordsControllerиспользуется для обновления координат адреса заказа. - Маршруты: Обрабатываются POST-запрос по маршруту
/sendpulse/set-coords.
Формат запроса
Параметры запроса:
{
"shortCode": "QWE-123-123",
"coordinate": "12.12, 21.2112"
}
Валидация и преобразование данных
Валидируется наличие параметров запроса.
Основная логика
После проверки данных Json контроллер обновляет lat, long в адрессе, который ассоциируется с указанным заказом.
Взаимодействие с микросервисами
- Hasura: Обновление адреса заказа.
Ответы сервера
200 OK
400 badRequest.500 internalServerError.- Inheritance
-
- Object
- Controller
- SetCoordsController
Constructors
Properties
- endpoint ↔ String
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- orderRepository → OrderRepository
-
final
- 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