Skip to content

Commit

Permalink
implementazione metodi nel controller
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobonaccorso committed Mar 6, 2021
1 parent 0abfaea commit ade5496
Showing 1 changed file with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,44 @@
*/
package it.sirfin.archivio.di.clienti.controller;

import it.sirfin.archivio.di.clienti.dto.ClienteDto;
import it.sirfin.archivio.di.clienti.dto.CriterioRicercaDto;
import it.sirfin.archivio.di.clienti.dto.ListaClientiDto;
import it.sirfin.archivio.di.clienti.service.ClientiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
*
* @author Francesco Lillo
*/
@CrossOrigin("*")
@RestController
public class ArchivioClientiController {


@Autowired
ClientiService GestioneClientiService;

@RequestMapping("/inserisciCliente")
@ResponseBody
public ListaClientiDto inserisciCliente(@RequestBody ClienteDto dto) {
System.out.println("sono in inserisci cliente" + dto);
return GestioneClientiService.inserisciCliente(dto.getCliente());
}

@RequestMapping("/ricerca-cliente")
@ResponseBody
public ListaClientiDto ricercaCliente(@RequestBody CriterioRicercaDto dto) {
return GestioneClientiService.ricercaCliente(dto.getCriterio());
}

@RequestMapping("/cancella-cliente")
@ResponseBody
public ListaClientiDto cancellaCliente(@RequestBody ClienteDto dto) {
return GestioneClientiService.cancellaCliente(dto.getCliente());
}
}

0 comments on commit ade5496

Please sign in to comment.