Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gdonega/c0091ee1681818aae3f127f2d2dffd21 to your computer and use it in GitHub Desktop.
Save gdonega/c0091ee1681818aae3f127f2d2dffd21 to your computer and use it in GitHub Desktop.
package com.testes.spring.exemplo.empresas.rest;
import org.springframework.beans.factory.annotation.Autowired;
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 com.testes.spring.exemplo.empresas.dtos.CnpjDto;
import com.testes.spring.exemplo.empresas.services.EmpresaEnvelopeService;
@RestController
@RequestMapping("/rest/empresa-envelope")
public class EmpresaEnvelopeController {
@Autowired
private EmpresaEnvelopeService service;
@PostMapping
public ResponseEntity<Object> salvarCnpj(@RequestBody CnpjDto cnpjDto) {
service.salvarCnpj(cnpjDto.getCnpj());
return ResponseEntity.ok().build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment