From 703e651daa659213e41dca8a45e9fe26f87655ea Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Sun, 14 Dec 2025 09:31:28 -0300 Subject: [PATCH] docs: update swagger.json with Jobs endpoints and fix README - Add Jobs endpoints to swagger.json manually (/jobs GET, POST, /jobs/{id} GET, PUT, DELETE) - Update README.md Swagger URL from /swagger/ to /docs/ - Add production URL: https://api-dev.gohorsejobs.com/docs/index.html - Expand endpoints table with all available routes - Fix port from 8080 to 8521 --- README.md | 12 ++- backend/docs/swagger.json | 198 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0af855d..5cfb16a 100644 --- a/README.md +++ b/README.md @@ -230,19 +230,27 @@ npm run seed ## 📖 Documentação da API ### Swagger UI -Acesse a documentação interativa em: **http://localhost:8080/swagger/index.html** +Acesse a documentação interativa em: **http://localhost:8521/docs/index.html** + +> **Produção:** https://api-dev.gohorsejobs.com/docs/index.html ### Endpoints Principais | Método | Endpoint | Descrição | Autenticação | |--------|----------|-----------|--------------| +| `GET` | `/` | Info da API + IP | ❌ | | `GET` | `/health` | Health check | ❌ | | `POST` | `/api/v1/auth/login` | Login | ❌ | | `POST` | `/api/v1/companies` | Criar empresa | ❌ | +| `GET` | `/api/v1/companies` | Listar empresas | ❌ | | `GET` | `/api/v1/users` | Listar usuários | ✅ JWT | | `POST` | `/api/v1/users` | Criar usuário | ✅ JWT | +| `DELETE` | `/api/v1/users/{id}` | Deletar usuário | ✅ JWT | | `GET` | `/jobs` | Listar vagas | ❌ | -| `POST` | `/jobs` | Criar vaga | ✅ JWT | +| `POST` | `/jobs` | Criar vaga | ❌ | +| `GET` | `/jobs/{id}` | Detalhes da vaga | ❌ | +| `PUT` | `/jobs/{id}` | Atualizar vaga | ❌ | +| `DELETE` | `/jobs/{id}` | Deletar vaga | ❌ | --- diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index 999d8b1..5271054 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -277,6 +277,204 @@ } } } + }, + "/jobs": { + "get": { + "description": "Get a paginated list of job postings with optional filters", + "produces": [ + "application/json" + ], + "tags": [ + "Jobs" + ], + "summary": "List all jobs", + "parameters": [ + { + "type": "integer", + "description": "Page number", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "Items per page", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Filter by company ID", + "name": "companyId", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "description": "Create a new job posting", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jobs" + ], + "summary": "Create a new job", + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + } + }, + "/jobs/{id}": { + "get": { + "description": "Get a single job posting by its ID", + "produces": [ + "application/json" + ], + "tags": [ + "Jobs" + ], + "summary": "Get job by ID", + "parameters": [ + { + "type": "integer", + "description": "Job ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "404": { + "description": "Not Found", + "schema": { + "type": "string" + } + } + } + }, + "put": { + "description": "Update an existing job posting", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jobs" + ], + "summary": "Update a job", + "parameters": [ + { + "type": "integer", + "description": "Job ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "description": "Delete a job posting", + "produces": [ + "application/json" + ], + "tags": [ + "Jobs" + ], + "summary": "Delete a job", + "parameters": [ + { + "type": "integer", + "description": "Job ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + } } }, "definitions": {