Giter VIP home page Giter VIP logo

2020-dblandit-tp-api-rest's Introduction

2020-dblandit-tp-api-rest

API REST para la empresa DBlandIT.

Listar los cursos

Lista los cursos existentes en base a los filtros solicitados.

  • ENDPOINT

    GET /cursos

  • Query Params

    Optional:

    duracion=[number]

    anio=[integer]

  • Success Response:

    • Code: 200
      Content:
          [
              { 
                  "_id": "5e359ea10d297916bd30ef89", 
                  "anio": 2020, 
                  "duracion": 60, 
                  "tema": "BigData", 
                  "alumnos": [{ "_id": "5e359ea10d297916bd30efkla", "nombre": "Kevin", "apellido": "Szuchet", "dni": "12345678", "direccion": "Av. Siempreviva 123", "nota": 10 }]
              }                
          ]
  • Error Response:

    • Code: 400 - BAD REQUEST
      Content: { error : "El {año/duración} debe ser numérico" || "El {año/duración} debe ser positivo" || "Debe elegir el tema del curso" }

Crear cursos

Crea un nuevo curso.

  • ENDPOINT

    POST /cursos

  • Data Params

        { 
            "anio": 2020, 
            "duracion": 60, 
            "tema": "BigData", 
            "alumnos": [{ "nombre": "Kevin", "apellido": "Szuchet", "dni": "12345678", "direccion": "Av. Siempreviva 123", "nota": 10 }] 
        }
  • Success Response:

    • Code: 201
      Content:
          { 
              "_id": "5e359ea10d297916bd30efkla", 
              "anio": 2020, 
              "duracion": 60, 
              "tema": "BigData", 
              "alumnos": [{ "_id": "asfiauf897af", "nombre": "Kevin", "apellido": "Szuchet", "dni": "12345678", "direccion": "Av. Siempreviva 123", "nota": 10 }]
          }
  • Error Response:

    • Code: 400 - BAD REQUEST
      Content: { error : "El {año/duración} debe ser numérico" || "El {año/duración} debe ser positivo" || "Debe elegir el tema del curso" }

Eliminar un curso

Elimina un curso existente.

  • ENDPOINT

    DELETE /cursos/:id

  • Success Response:

    • Code: 204
  • Error Response:

    • Code: 404 - NOT FOUND
      Content: { error : "El curso solicitado no existe" }

Listar alumnos de un curso

Lista los alumnos del curso solicitado en base a los filtros elegidos.

  • ENDPOINT

    GET /cursos/:id/alumnos

  • Query Params

    Optional:

    sortBy=[string {nombre,apellido,dni,nota}]

    sortType=[string {ASC, DESC, asc, desc}]

    limit=[integer]

  • Success Response:

    • Code: 200 Content:
          [
              { 
                  "_id": "5e359ea10d297916bd30ef89", 
                  "nombre": "Kevin", 
                  "apellido": "Szuchet", 
                  "dni": "12345678", 
                  "direccion": "Av. Siempreviva 123", 
                  "nota": 10 
              }
          ]
  • Error Response:

    • Code: 404 - NOT FOUND
      Content: { error : "El curso solicitado no existe" }

2020-dblandit-tp-api-rest's People

Contributors

kevinszuchet avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.