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
This commit is contained in:
parent
9667e94545
commit
703e651daa
2 changed files with 208 additions and 2 deletions
12
README.md
12
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 | ❌ |
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue