Crud usando Spring
- Java JDK 17 ou superior
- Apache Maven
1. Clone o projeto
git clone https://github.com/wander740/spring-api-crud.git
2. Compila as classes
mvn compile
3. Execute o aplicativo usando o maven
mvn spring-boot:run
O aplicativo será executado no http://localhost:8080
Method | Url | Description | Sample Valid Request Body |
---|---|---|---|
GET | /api/news | Obtenha todas as postagens | |
GET | /api/news/{id} | Obter postagem por ID | |
GET | /api/news/searchByName | Procura as postagem por uma string | |
POST | /api/news | Criar nova postagem | JSON |
PUT | /api/news/{id} | Atualizar postagem | JSON |
DELETE | /api/news/{id} | Excluir postagem |
Method | Url | Description | Sample Valid Request Body |
---|---|---|---|
GET | /api/category | Obtenha todas as categorias | |
GET | /api/category/{id} | Obter categoria por ID | |
POST | /api/category | Criar nova categoria | JSON |
{
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"text": "quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto",
"category_id": 1
}
{
"title": "UPDATED UPDATED UPDATED UPDATED UPDATED UPDATED",
"text": "UPDATED UPDATED UPDATED UPDATED UPDATED UPDATED UPDATED UPDATED UPDATED UPDATED",
"category_id": 1
}
{
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
}