SendSMSController class

Введение

  1. Описание: Контроллер SendSMSController используется для отправки сообщений в систему SendPulls.
  2. Маршруты: Обрабатываются POST-запрос по маршруту /sendpulse/send-sms.

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

Тело запроса: JSON-объект, содержащий идентификатор пользователя.

{
  "message": "message",
  "phone": "+56543345123"
}

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

  1. Отправка сообщений: Контроллер отправляет sms по маршруту https://api.sendpulse.com/sms/send.

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

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

  1. Успешное выполнение: Ожидаемый статус - 200 OK.
      {
        "message": "Sendpulse: SMS sent"
      }
  2. Ошибки обработки: Возможны различные ошибки.
    1. Ошибка при отправке сообщений. Ожидаемый статус - 500 internalServerError.
Inheritance

Constructors

SendSMSController()

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
smsRepository → SMSRepository
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