feat: Documentar API
This commit is contained in:
parent
c435b8439c
commit
deb58b1679
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/Config" isTestSource="false" packagePrefix="Config\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/OAuth" isTestSource="false" packagePrefix="OAuth\" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/defuse/php-encryption" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/fig/http-message-util" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/lcobucci/clock" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/lcobucci/jwt" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/league/event" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/league/oauth2-server" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/league/uri" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/league/uri-interfaces" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/paragonie/random_compat" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/clock" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/slim/psr7" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/stella-maris/clock" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/LANIA_API.iml" filepath="$PROJECT_DIR$/.idea/LANIA_API.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MessDetectorOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCSFixerOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||
<option name="highlightLevel" value="WARNING" />
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/fig/http-message-util" />
|
||||
<path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
|
||||
<path value="$PROJECT_DIR$/vendor/defuse/php-encryption" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/clock" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
|
||||
<path value="$PROJECT_DIR$/vendor/slim/psr7" />
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/uri" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/event" />
|
||||
<path value="$PROJECT_DIR$/vendor/lcobucci/jwt" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/oauth2-server" />
|
||||
<path value="$PROJECT_DIR$/vendor/lcobucci/clock" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/uri-interfaces" />
|
||||
<path value="$PROJECT_DIR$/vendor/stella-maris/clock" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.0">
|
||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
||||
</component>
|
||||
<component name="PhpStanOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PsalmOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="bca6133c-c107-41b2-a441-7783a72cc6b8" name="Changes" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ComposerSettings" synchronizationState="SYNCHRONIZE">
|
||||
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
|
||||
<execution />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="PhpDebugGeneral" listening_started="true" />
|
||||
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="$PROJECT_DIR$/../../../php/php.exe">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/fig/http-message-util" />
|
||||
<path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
|
||||
<path value="$PROJECT_DIR$/vendor/defuse/php-encryption" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/clock" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
|
||||
<path value="$PROJECT_DIR$/vendor/slim/psr7" />
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/uri" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/event" />
|
||||
<path value="$PROJECT_DIR$/vendor/lcobucci/jwt" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/oauth2-server" />
|
||||
<path value="$PROJECT_DIR$/vendor/lcobucci/clock" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/uri-interfaces" />
|
||||
<path value="$PROJECT_DIR$/vendor/stella-maris/clock" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="ProjectColorInfo"><![CDATA[{
|
||||
"associatedIndex": 3
|
||||
}]]></component>
|
||||
<component name="ProjectId" id="2xHr9lEAACuzJI73Ex2dSUXULDF" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"PHP Script.Candidato.php.executor": "Run",
|
||||
"PHP Script.database.php.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"last_opened_file_path": "C:/xampp/htdocs/Desarrollo de Software/LANIA_API",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-js-predefined-d6986cc7102b-6a121458b545-JavaScript-PS-251.25410.148" />
|
||||
<option value="bundled-php-predefined-a98d8de5180a-c5828cf854d9-com.jetbrains.php.sharedIndexes-PS-251.25410.148" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="bca6133c-c107-41b2-a441-7783a72cc6b8" name="Changes" comment="" />
|
||||
<created>1747605691277</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1747605691277</updated>
|
||||
<workItem from="1747605692970" duration="221000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,218 @@
|
|||
openapi: 3.0.3
|
||||
info:
|
||||
title: API de Candidatos
|
||||
description: |
|
||||
API para gestionar información de candidatos con autenticación OAuth 2.0.
|
||||
Permite obtener información detallada de candidatos incluyendo datos demográficos,
|
||||
formación académica, exámenes y experiencia de servicio.
|
||||
version: 1.0.0
|
||||
|
||||
servers:
|
||||
- url: /api
|
||||
description: Servidor principal
|
||||
|
||||
security:
|
||||
- oauth2: []
|
||||
|
||||
paths:
|
||||
/oauth/token:
|
||||
post:
|
||||
summary: Obtener token de acceso OAuth 2.0
|
||||
description: Endpoint para obtener un token de acceso utilizando credenciales de cliente
|
||||
tags:
|
||||
- Autenticación
|
||||
security: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- grant_type
|
||||
- client_id
|
||||
- client_secret
|
||||
properties:
|
||||
grant_type:
|
||||
type: string
|
||||
enum: [client_credentials]
|
||||
description: Tipo de autorización OAuth 2.0
|
||||
client_id:
|
||||
type: string
|
||||
description: Identificador del cliente
|
||||
client_secret:
|
||||
type: string
|
||||
description: Secreto del cliente
|
||||
scope:
|
||||
type: string
|
||||
description: Alcances solicitados (opcional)
|
||||
responses:
|
||||
'200':
|
||||
description: Token de acceso generado exitosamente
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
token_type:
|
||||
type: string
|
||||
example: Bearer
|
||||
expires_in:
|
||||
type: integer
|
||||
example: 3600
|
||||
access_token:
|
||||
type: string
|
||||
example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
'400':
|
||||
description: Solicitud inválida o credenciales incorrectas
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
'401':
|
||||
description: No autorizado
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
|
||||
/candidatos/obtenerCandidatos:
|
||||
get:
|
||||
summary: Obtener lista de candidatos
|
||||
description: Devuelve un listado de todos los candidatos con información detallada
|
||||
tags:
|
||||
- Candidatos
|
||||
responses:
|
||||
'200':
|
||||
description: Lista de candidatos obtenida correctamente
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Candidato'
|
||||
'401':
|
||||
description: No autorizado - Token de acceso inválido o expirado
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
'500':
|
||||
description: Error del servidor
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
oauth2:
|
||||
type: oauth2
|
||||
flows:
|
||||
clientCredentials:
|
||||
tokenUrl: /api/oauth/token
|
||||
scopes: {}
|
||||
|
||||
schemas:
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: invalid_request
|
||||
message:
|
||||
type: string
|
||||
example: El token de acceso proporcionado es inválido
|
||||
|
||||
Candidato:
|
||||
type: object
|
||||
properties:
|
||||
id_candidato:
|
||||
type: string
|
||||
description: Identificador único del candidato
|
||||
nombre_completo:
|
||||
type: string
|
||||
description: Nombre completo del candidato
|
||||
contacto:
|
||||
type: object
|
||||
properties:
|
||||
correo:
|
||||
type: string
|
||||
format: email
|
||||
description: Correo electrónico del candidato
|
||||
telefono:
|
||||
type: string
|
||||
description: Número telefónico del candidato
|
||||
demograficos:
|
||||
type: object
|
||||
properties:
|
||||
genero:
|
||||
type: string
|
||||
description: Género del candidato
|
||||
rango_edad:
|
||||
type: string
|
||||
description: Rango de edad del candidato
|
||||
tipo_identificacion:
|
||||
type: string
|
||||
description: Tipo de identificación del candidato
|
||||
ubicacion:
|
||||
type: object
|
||||
properties:
|
||||
pais:
|
||||
type: string
|
||||
description: País de residencia
|
||||
estado:
|
||||
type: string
|
||||
description: Estado o provincia
|
||||
municipio:
|
||||
type: string
|
||||
description: Municipio o ciudad
|
||||
colonia:
|
||||
type: string
|
||||
description: Colonia o barrio
|
||||
formacion:
|
||||
type: object
|
||||
properties:
|
||||
nivel_estudio:
|
||||
type: string
|
||||
description: Nivel de estudios del candidato
|
||||
giro:
|
||||
type: string
|
||||
description: Sector o giro de actividad
|
||||
nombre_empresa_institucion:
|
||||
type: string
|
||||
description: Nombre de la empresa o institución donde trabaja/estudia
|
||||
examen:
|
||||
type: object
|
||||
properties:
|
||||
id_examen:
|
||||
type: string
|
||||
description: Identificador del examen
|
||||
nombre_examen:
|
||||
type: string
|
||||
description: Nombre del examen realizado
|
||||
motivo:
|
||||
type: string
|
||||
description: Motivo por el cual realizó el examen
|
||||
experiencia_servicio:
|
||||
type: object
|
||||
properties:
|
||||
calificacion_servicio:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 10
|
||||
description: Calificación del servicio (0-10)
|
||||
consentimiento_publicidad:
|
||||
type: boolean
|
||||
description: Consentimiento para recibir publicidad
|
||||
fechas:
|
||||
type: object
|
||||
properties:
|
||||
entrada:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Fecha y hora de entrada
|
||||
salida:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Fecha y hora de salida
|
Loading…
Reference in New Issue