{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "API de Clases", "description": "Documentación de la API para gestionar clases y comentarios" }, "tags": [ { "name": "Clases", "description": "Endpoints relacionados a clases" }, { "name": "Users", "description": "Endpoints relacionados a usuarios" }, { "name": "Clases contratadas", "description": "Endpoints relacionados a clases contratadas" }, { "name": "Comentarios", "description": "Endpoints relacionados a comentarios" } ], "basePath": "/api", "paths": { "/clase/ver-clase/{id}": { "get": { "tags": [ "Clases" ], "summary": "Obtiene los detalles de una clase", "parameters": [ { "in": "path", "name": "id", "description": "ID de la clase", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "clase": { "type": "object", "properties": { "claseId": { "type": "string" }, "title": { "type": "string" }, "statusClase": { "type": "boolean" }, "category": { "type": "string" }, "tipoClase": { "type": "string" }, "frecuencia": { "type": "string" }, "duracion": { "type": "string" }, "description": { "type": "string" }, "price": { "type": "number" }, "imgUrl": { "type": "string" }, "profesor": { "type": "object", "properties": { "profesorId": { "type": "string" }, "profesorName": { "type": "string" }, "profesorExp": { "type": "string" }, "profesorBio": { "type": "string" }, "profesorTitulo": { "type": "string" } } }, "comments": { "type": "array", "items": { "type": "object", "properties": { "statusComentario": { "type": "boolean" }, "commentId": { "type": "string" }, "comentarioInfo": { "type": "string" }, "calificacion": { "type": "number" }, "autor": { "type": "string" }, "createDate": { "type": "string" } } } }, "calificacion": { "type": "object", "properties": { "calificacion": { "type": "number" } } } } } } } } } } }, "/clase/catalogo": { "get": { "tags": [ "Clases" ], "summary": "Obtiene el catálogo de clases", "parameters": [ { "in": "query", "name": "limit", "description": "Cantidad máxima de resultados a devolver", "type": "integer" }, { "in": "query", "name": "from", "description": "Número de resultados a omitir al inicio", "type": "integer" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "total": { "type": "integer" }, "clases": { "type": "array", "items": { "type": "object", "properties": { "claseId": { "type": "string" }, "title": { "type": "string" }, "profesorName": { "type": "string" }, "category": { "type": "string" }, "tipoClase": { "type": "string" }, "frecuencia": { "type": "string" }, "duracion": { "type": "string" }, "calificacion": { "type": "number" }, "price": { "type": "number" }, "imgUrl": { "type": "string" } } } } } } } } } }, "/clase/crear-clase": { "post": { "tags": [ "Clases" ], "summary": "Crea una nueva clase", "parameters": [ { "in": "body", "name": "body", "description": "Datos de la nueva clase", "required": true, "schema": { "type": "object", "properties": { "title": { "type": "string" }, "profesorId": { "type": "string" }, "category": { "type": "string" }, "tipoClase": { "type": "string" }, "frecuencia": { "type": "string" }, "duracion": { "type": "string" }, "description": { "type": "string" }, "price": { "type": "number" }, "imgUrl": { "type": "string" }, "commentId": { "type": "array", "items": { "type": "string" } } } } } ], "responses": { "201": { "description": "Clase creada exitosamente" } } } }, "/clase/actualizar-clase/{id}": { "put": { "tags": [ "Clases" ], "summary": "Actualiza una clase existente", "parameters": [ { "in": "path", "name": "id", "description": "ID de la clase a actualizar", "required": true, "type": "string" }, { "in": "body", "name": "body", "description": "Datos actualizados de la clase", "required": true, "schema": { "type": "object", "properties": { "title": { "type": "string" }, "profesorId": { "type": "string" }, "category": { "type": "string" }, "tipoClase": { "type": "string" }, "frecuencia": { "type": "string" }, "duracion": { "type": "string" }, "description": { "type": "string" }, "price": { "type": "number" }, "imgUrl": { "type": "string" }, "comments": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "comentarioInfo": { "type": "string" }, "calificacion": { "type": "number" }, "autor": { "type": "string" } } } } } } } ], "responses": { "200": { "description": "Clase actualizada exitosamente" } } } }, "/clase/borrar-clase/{id}": { "delete": { "tags": [ "Clases" ], "summary": "Elimina una clase", "parameters": [ { "in": "path", "name": "id", "description": "ID de la clase a eliminar", "required": true, "type": "string" } ], "responses": { "200": { "description": "Clase eliminada exitosamente" } } } }, "/clase/mis-clases/{id}": { "get": { "tags": [ "Clases" ], "summary": "Obtiene las clases de un profesor", "parameters": [ { "in": "path", "name": "id", "description": "ID del profesor", "required": true, "type": "string" }, { "in": "query", "name": "limit", "description": "Cantidad máxima de resultados a devolver", "type": "integer" }, { "in": "query", "name": "from", "description": "Número de resultados a omitir al inicio", "type": "integer" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "total": { "type": "integer" }, "clases": { "type": "array", "items": { "type": "object", "properties": { "claseId": { "type": "string" }, "title": { "type": "string" }, "profesorName": { "type": "string" }, "category": { "type": "string" }, "tipoClase": { "type": "string" }, "frecuencia": { "type": "string" }, "duracion": { "type": "string" }, "calificacion": { "type": "number" }, "price": { "type": "number" }, "imgUrl": { "type": "string" } } } } } } } } } }, "/clase/actualizar-comment/{id}": { "put": { "tags": [ "Comentarios" ], "summary": "Actualiza el estado de un comentario", "parameters": [ { "in": "path", "name": "id", "description": "ID del comentario a actualizar", "required": true, "type": "string" }, { "in": "body", "name": "body", "description": "Datos actualizados del comentario", "required": true, "schema": { "type": "object", "properties": { "statusComentario": { "type": "boolean" } } } } ], "responses": { "200": { "description": "Comentario actualizado exitosamente" } } } }, "/clase/create-comment": { "post": { "tags": [ "Comentarios" ], "summary": "Crea un nuevo comentario", "parameters": [ { "in": "body", "name": "body", "description": "Datos del nuevo comentario", "required": true, "schema": { "type": "object", "properties": { "claseId": { "type": "string" }, "claseContratadaId": { "type": "string" }, "comentarioInfo": { "type": "string" }, "calificacion": { "type": "number" }, "autor": { "type": "string" } } } } ], "responses": { "200": { "description": "Comentario creado exitosamente" } } } }, "/clase/lista-comentarios": { "get": { "tags": [ "Clases" ], "summary": "Obtiene la lista de comentarios con calificación mayor o igual a 4.5", "parameters": [ { "in": "query", "name": "limit", "description": "Cantidad máxima de resultados a devolver", "type": "integer" }, { "in": "query", "name": "from", "description": "Número de resultados a omitir al inicio", "type": "integer" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "total": { "type": "integer" }, "comentariosData": { "type": "array", "items": { "type": "object", "properties": { "comentarioInfo": { "type": "string" }, "calificacion": { "type": "number" }, "statusComentario": { "type": "boolean" }, "autor": { "type": "string" }, "createDate": { "type": "string" } } } } } } } } } }, "/clase-contratada/contratar/{id}": { "post": { "tags": [ "Clases contratadas" ], "summary": "Contratar una clase", "parameters": [ { "in": "path", "name": "id", "description": "ID de la clase a contratar", "required": true, "type": "string" }, { "in": "body", "name": "body", "description": "Datos de la clase contratada", "required": true, "schema": { "type": "object", "properties": { "telefono": { "type": "string" }, "mail": { "type": "string" }, "horario": { "type": "string" }, "mensaje": { "type": "string" }, "nombreAlumno": { "type": "string" } } } } ], "responses": { "201": { "description": "Clase contratada exitosamente" }, "400": { "description": "Error al contratar la clase" } } } }, "/clase-contratada/ver-clase-contratada/{id}": { "get": { "tags": [ "Clases contratadas" ], "summary": "Obtener detalles de una clase contratada", "parameters": [ { "in": "path", "name": "id", "description": "ID de la clase contratada", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "claseContratadaId": { "type": "string" }, "claseId": { "type": "string" }, "title": { "type": "string" }, "statusCompletada": { "type": "boolean" }, "statusAceptada": { "type": "boolean" }, "telefono": { "type": "string" }, "mail": { "type": "string" }, "horario": { "type": "string" }, "mensaje": { "type": "string" }, "imgUrl": { "type": "string" }, "nombreAlumno": { "type": "string" } } } } } } }, "/clase-contratada/lista-clases-contratada/{id}": { "get": { "tags": [ "Clases contratadas" ], "summary": "Obtener la lista de clases contratadas de un profesor", "parameters": [ { "in": "path", "name": "id", "description": "ID del profesor", "required": true, "type": "string" }, { "in": "query", "name": "limit", "description": "Cantidad máxima de resultados a devolver", "type": "integer" }, { "in": "query", "name": "from", "description": "Número de resultados a omitir al inicio", "type": "integer" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "total": { "type": "integer" }, "claseContratadas": { "type": "array", "items": { "type": "object", "properties": { "claseContratadaId": { "type": "string" }, "claseId": { "type": "string" }, "title": { "type": "string" }, "statusCompletada": { "type": "boolean" }, "statusAceptada": { "type": "boolean" }, "telefono": { "type": "string" }, "mail": { "type": "string" }, "horario": { "type": "string" }, "mensaje": { "type": "string" }, "imgUrl": { "type": "string" }, "nombreAlumno": { "type": "string" } } } } } } } } } }, "/clase-contratada/lista-clases-contratada-status/{id}": { "put": { "tags": [ "Clases contratadas" ], "summary": "Actualizar el estado de una clase contratada", "parameters": [ { "in": "path", "name": "id", "description": "ID de la clase contratada a actualizar", "required": true, "type": "string" }, { "in": "body", "name": "body", "description": "Datos actualizados del estado de la clase contratada", "required": true, "schema": { "type": "object", "properties": { "statusClaseContratada": { "type": "boolean" } } } } ], "responses": { "200": { "description": "Clase contratada actualizada exitosamente" } } } }, "/clase-contratada/clases-contratada-status-completada/{id}": { "put": { "tags": [ "Clases contratadas" ], "summary": "Actualizar el estado de una clase contratada", "parameters": [ { "in": "path", "name": "id", "description": "ID de la clase contratada a actualizar", "required": true, "type": "string" }, { "in": "body", "name": "body", "description": "Datos actualizados del estado de la clase contratada", "required": true, "schema": { "type": "object", "properties": { "statusCompletada": { "type": "boolean" } } } } ], "responses": { "200": { "description": "Clase contratada completada exitosamente" } } } }, "/users/registration": { "post": { "tags": [ "Users" ], "description": "Registrar un nuevo usuario", "parameters": [ { "in": "body", "name": "body", "description": "Datos de un nuevo usuario", "required": true, "schema": { "type": "object", "properties": { "name": { "type": "string" }, "lastName": { "type": "string" }, "email": { "type": "string" }, "password": { "type": "string" }, "titulo": { "type": "string" }, "exp": { "type": "number" }, "imgUrl": { "type": "string" }, "telefono": { "type": "number" }, "bio": { "type": "string" } } } } ], "responses": { "201": { "description": "Usuario registrado exitosamente" } } } }, "/users/reset-password": { "post": { "tags": [ "Users" ], "description": "Restablecer la contraseña del usuario", "parameters": [ { "in": "body", "name": "body", "description": "Datos de la nueva clase", "required": true, "schema": { "type": "object", "properties": { "email": { "type": "string" } } } } ], "responses": { "200": { "description": "Reinicio de contraseña enviado a {email}" }, "400": { "description": "No existe usuario con el correo proporcionado" } } } }, "/users/login/": { "post": { "tags": [ "Users" ], "description": "Iniciar sesión de usuario", "parameters": [ { "in": "body", "name": "body", "description": "Datos de la nueva clase", "required": true, "schema": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } } } } ], "responses": { "200": { "description": "Inicio de sesión exitoso" }, "401": { "description": "Credenciales inválidas" } } } }, "/users/userById/{id}": { "get": { "tags": [ "Users" ], "description": "Obtener información de un usuario por ID", "parameters": [ { "name": "id", "type": "string", "in": "path", "description": "ID del usuario", "required": true } ], "responses": { "200": { "description": "Operación exitosa" }, "400": { "description": "ID no válido" } } } }, "/users/update": { "put": { "tags": [ "Users" ], "description": "Actualizar la información del usuario", "parameters": [ { "in": "body", "name": "body", "description": "Datos de la nueva clase", "required": true, "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "lastName": { "type": "string" }, "email": { "type": "string" }, "password": { "type": "string" }, "titulo": { "type": "string" }, "exp": { "type": "number" }, "imgUrl": { "type": "string" }, "telefono": { "type": "number" }, "bio": { "type": "string" } } } } ], "responses": { "200": { "description": "Operación exitosa" }, "400": { "description": "Error en la solicitud" } } } }, "/users/users": { "get": { "tags": [ "Users" ], "description": "Obtener la lista de todos los usuarios", "responses": { "200": { "description": "Operación exitosa" }, "400": { "description": "Error en la solicitud" } } } } }, "definitions": { "Clase": { "type": "object", "properties": { "title": { "type": "string" }, "profesorId": { "type": "string" }, "statusClase": { "type": "boolean" }, "category": { "type": "string" }, "tipoClase": { "type": "string" }, "frecuencia": { "type": "string" }, "duracion": { "type": "string" }, "description": { "type": "string" }, "price": { "type": "number" }, "imgUrl": { "type": "string" }, "commentId": { "type": "array", "items": { "type": "string" } } } }, "Comentario": { "type": "object", "properties": { "comentarioInfo": { "type": "string" }, "calificacion": { "type": "number" }, "statusComentario": { "type": "boolean" }, "autor": { "type": "string" }, "createDate": { "type": "string" } } }, "Contratar Clase Response": { "type": "object", "properties": { "telefono": { "type": "string" }, "mail": { "type": "string" }, "horario": { "type": "string" }, "mensaje": { "type": "string" }, "nombreAlumno": { "type": "string" } } }, "Ver Clase Contratada Response": { "type": "object", "properties": { "claseContratadaId": { "type": "string" }, "claseId": { "type": "string" }, "title": { "type": "string" }, "statusCompletada": { "type": "boolean" }, "statusAceptada": { "type": "boolean" }, "telefono": { "type": "string" }, "mail": { "type": "string" }, "horario": { "type": "string" }, "mensaje": { "type": "string" }, "imgUrl": { "type": "string" }, "nombreAlumno": { "type": "string" } } }, "ListaC lases Contratadas Response": { "type": "object", "properties": { "total": { "type": "integer" }, "claseContratadas": { "type": "array", "items": { "$ref": "#/definitions/VerClaseContratadaResponse" } } } }, "Actualizar Estado Clase Request": { "type": "object", "properties": { "statusClaseContratada": { "type": "boolean" } } }, "User": { "type": "object", "properties": { "name": { "type": "string" }, "lastName": { "type": "string" }, "email": { "type": "string" }, "password": { "type": "string" }, "titulo": { "type": "string" }, "exp": { "type": "integer" }, "date": { "type": "string", "format": "date" }, "imgUrl": { "type": "string" }, "telefono": { "type": "integer" }, "bio": { "type": "string" } } } } }