Class ImageTypeRestController

java.lang.Object
org.imageconverter.controller.ImageTypeRestController

@Loggable @RestController @Description("Controller for image type API") @RequestMapping("/rest/images/type") public class ImageTypeRestController extends Object
Image type CRUD.
Author:
Fernando Romulo da Silva
  • Method Details

    • getById

      @ResponseStatus(OK) @GetMapping(value="/{id:[\\d]*}", produces="application/json") public ImageTypeResponse getById(@PathVariable(name="id",required=true) Long id)
      Get a image type by id.
      Parameters:
      id - The image type's id
      Returns:
      A ImageTypeResponse object
      Throws:
      ElementNotFoundException - if a element with id not found
    • getByFilter

      @ResponseStatus(OK) @GetMapping(produces="application/json") public org.springframework.data.domain.Page<ImageTypeResponse> getByFilter(org.springframework.data.jpa.domain.Specification<ImageType> filter, @PageableDefault(value=10,page=0) org.springframework.data.domain.Pageable page)
      Get image types.
      Parameters:
      filter - A object Specification that specific the filter the search, if you omit, bring all
      page - A object Pageable that page the result
      Returns:
      A List or a empty list
    • create

      @ResponseStatus(CREATED) @PostMapping(consumes="application/json", produces={"text/plain","application/json"}) public void create(@Valid @RequestBody @Valid CreateImageTypeRequest request, javax.servlet.http.HttpServletResponse response)
      Create a image type.
      Parameters:
      request - A CreateImageTypeRequest object. It works as a structure to create a ImageType
    • update

      @ResponseStatus(NO_CONTENT) @PutMapping(value="/{id:[\\d]*}", consumes="application/json") public void update(@PathVariable(name="id",required=true) Long id, @Valid @RequestBody @Valid UpdateImageTypeRequest request)
      Update a image type.
      Parameters:
      request - A UpdateImageTypeRequest object. It works as a structure to update a ImageType
    • delete

      @ResponseStatus(NO_CONTENT) @DeleteMapping("/{id:[\\d]*}") public void delete(@PathVariable(name="id",required=true) Long id)
      Delete a image type.
      Parameters:
      id - The image type's id