Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
Expand All @@ -25,4 +25,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1622470138815</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 1 addition & 1 deletion .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
activeProfiles=pom.xml
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
package br.com.serratec.trabalho.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import br.com.serratec.trabalho.model.Cliente;
import br.com.serratec.trabalho.repository.ClienteRepository;

@RestController
@RequestMapping("/api/clientes")
public class ClienteController {
@Autowired
private ClienteRepository _repositorioCliente ;

@PostMapping
public ResponseEntity<Cliente> adicionar(@RequestBody Cliente cliente) {

var adicionado = this._repositorioCliente.save(cliente);

return new ResponseEntity<Cliente>(adicionado, HttpStatus.CREATED);


}
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
package br.com.serratec.trabalho.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import br.com.serratec.trabalho.model.Produto;
import br.com.serratec.trabalho.repository.ProdutoRepository;

@RestController
@RequestMapping("/api/produtos")
public class ProdutoController {
@Autowired
private ProdutoRepository _repositorioProduto ;

@PostMapping
public ResponseEntity<Produto> adicionar(@RequestBody Produto produto) {

var adicionado = this._repositorioProduto.save(produto);

return new ResponseEntity<>(adicionado, HttpStatus.CREATED);

}

}
6 changes: 0 additions & 6 deletions target/classes/META-INF/MANIFEST.MF

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.