Class ProveedorController

java.lang.Object
com.deusto.coffeestack.controller.ProveedorController

@RestController @RequestMapping("/api/proveedores") public class ProveedorController extends Object
  • Constructor Details

  • Method Details

    • listar

      @GetMapping @PreAuthorize("isAuthenticated()") public org.springframework.data.domain.Page<ProveedorResponse> listar(org.springframework.data.domain.Pageable pageable)
    • obtener

      @GetMapping("/{id}") @PreAuthorize("isAuthenticated()") public ProveedorResponse obtener(@PathVariable Long id)
    • crear

      @PostMapping @PreAuthorize("hasAnyRole(\'EMPLEADO\',\'PROPIETARIO\',\'ROOT\')") public org.springframework.http.ResponseEntity<ProveedorResponse> crear(@Valid @RequestBody @Valid ProveedorCreateRequest request)
    • actualizar

      @PutMapping("/{id}") @PreAuthorize("hasAnyRole(\'EMPLEADO\',\'PROPIETARIO\',\'ROOT\')") public org.springframework.http.ResponseEntity<ProveedorResponse> actualizar(@PathVariable Long id, @Valid @RequestBody @Valid ProveedorCreateRequest request)
    • cambiarEstado

      @PatchMapping("/{id}/estado") @PreAuthorize("hasAnyRole(\'PROPIETARIO\',\'ROOT\')") public org.springframework.http.ResponseEntity<Void> cambiarEstado(@PathVariable Long id, @RequestParam boolean activo)
    • eliminar

      @DeleteMapping("/{id}") @PreAuthorize("hasAnyRole(\'PROPIETARIO\',\'ROOT\')") public org.springframework.http.ResponseEntity<Void> eliminar(@PathVariable Long id)