Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 4, 2019 21:59
Embed
What would you like to do?
package me.parzibyte.sistemaventasspringboot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(path = "/ventas")
public class VentasController {
@Autowired
VentasRepository ventasRepository;
@GetMapping(value = "/")
public String mostrarVentas(Model model) {
model.addAttribute("ventas", ventasRepository.findAll());
return "ventas/ver_ventas";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment