1.0.5 • Published 4 years ago

blindaje v1.0.5

Weekly downloads
-
License
MIT*
Repository
-
Last release
4 years ago

Blindaje

MIT license

npm.io

Start me up

Node env

  • Commands
    • Install dependencies: yarn
    • Run locally: yarn start
  • Build, be careful, you will require keys.
    • Build android: yarn build:android
    • Build ios: yarn build:ios

Links

APIS

Login

  // POST - https://incidencias.blindajeseguridad.com.ar:8181/ws/auth/login
  {
	  "usuario": "matias",
	  "clave": "cisco"
  }
  // Response:
  {
	  "JWT": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNYXRpYXMgUGFuYXNjaSIsImlhdCI6MTU3OTkwMzU5MywiZXhwIjoxNTc5OTg5OTkzLCJpZCI6MSwiZW1haWwiOiJwYW5hc2NpLm1hdGlhc0BnbWFpbC5jb20ifQ.sAw-h1S9Xii4vNpQ5ou_P_tj-DwzWFJaF0IqWrLT3DI"
  }
  // Detalle del Token
  {
    "sub": "Matias Panasci",
    "iat": 1579903593,
    "exp": 1579989993,
    "id": 1,
    "email": "panasci.matias@gmail.com"
  }

Eventos

  // POST - https://incidencias.blindajeseguridad.com.ar:8181/ws/evento/add
  {
    "type": 10,
    "time": 10000
  }
  // Response:
  {
	  "Event": "{\"id\":598967}"
  }
  // DELETE - https://incidencias.blindajeseguridad.com.ar:8181/ws/evento/delete/{idEvento}
  // Response:
  HTTP STATUS CODE 202 (ACCEPTED)

Historial

  // POST - https://incidencias.blindajeseguridad.com.ar:8181/ws/historial/list
  {
    "first": 0,
    "last": 10
  }
  // Response:
  [
    {
      "id": 598966,
      "type": 1,
      "time": 0,
      "description": "Delivery",
      "eventDate": 1579910045000
    },
    {
      "id": 598967,
      "type": 1,
      "time": 0,
      "description": "Delivery",
      "eventDate": 1579909480000
    }
  ]

Tips:

  • En el método del login puse los datos del usuario que me parecieron importantes, si necesitas otro me avisas
  • Para el método ADD te paso una lista de los eventos que hay, sentite libre de agregar los que necesites.
  • En el método DELETE me pareció mejor poner el ID en la URL y solo responder con el STATUS CODE si preferís tu formato, avisame y lo cambio.
  • En el historial, te hago pasar dos parámetros que son el primer registro y el ultimo que queres por si tiene muchos, para que puedas hacer paginación.
  • En el historial el primer elemento es el 0.

Tabla de eventos

idTipoEventnombre
1Delivery
2Error de usuario
3Falla Tecnica
4Mudanza
5Puerta mal cerrada
6Puerta cerrada correctamente
7Solo placas
8Limpieza
9Entradera
10Viaje seguro