Class ProductController

java.lang.Object
org.openwms.core.http.AbstractWebController
org.openwms.wms.inventory.rest.ProductController

@Validated @MeasuredRestController public class ProductController extends org.openwms.core.http.AbstractWebController
A ProductController.
Author:
Heiko Scherrer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
    private final org.ameba.mapping.BeanMapper
     
    private final ProductMapper
     
    private final ProductService
     
    private final jakarta.validation.Validator
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProductController(ProductService productService, org.ameba.mapping.BeanMapper mapper, ProductMapper productMapper, jakarta.validation.Validator validator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Void>
    create(@NotNull @Size(min=1) List<ProductVO> products, jakarta.servlet.http.HttpServletRequest req)
     
    org.springframework.http.ResponseEntity<Void>
    delete(String pKey)
     
    org.springframework.http.ResponseEntity<List<ProductVO>>
     
    org.springframework.http.ResponseEntity<ProductVO>
     
    org.springframework.http.ResponseEntity<ProductVO>
     
    org.springframework.http.ResponseEntity<ProductVO>
     
    org.springframework.http.ResponseEntity<ProductVO>
     
    static org.springframework.hateoas.Link
     
    org.springframework.http.ResponseEntity<org.openwms.core.http.Index>
     
    org.springframework.http.ResponseEntity<ProductVO>
    update(@Valid @NotNull ProductVO product)
     

    Methods inherited from class org.openwms.core.http.AbstractWebController

    buildNOKResponse, buildNOKResponseWithKey, buildOKResponse, buildResponse, buildResponse, getLocationForCreatedResource, getLocationURIForCreatedResource, handleBehaviorAwareException, handleBusinessRuntimeException, handleConstraintViolationException, handleException, handleHttpBusinessException, handleRemovalNotAllowedException, handleTechnicalRuntimeException, handleValidationException, illegalArgumentException, translate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • productService

      private final ProductService productService
    • mapper

      private final org.ameba.mapping.BeanMapper mapper
    • productMapper

      private final ProductMapper productMapper
    • validator

      private final jakarta.validation.Validator validator
  • Constructor Details

    • ProductController

      ProductController(ProductService productService, org.ameba.mapping.BeanMapper mapper, ProductMapper productMapper, jakarta.validation.Validator validator)
  • Method Details

    • getProductSelfLink

      public static org.springframework.hateoas.Link getProductSelfLink(ProductVO o)
    • index

      @GetMapping("/v1/products/index") public org.springframework.http.ResponseEntity<org.openwms.core.http.Index> index()
    • findAll

      @Transactional(readOnly=true) @GetMapping("/v1/products") public org.springframework.http.ResponseEntity<List<ProductVO>> findAll()
    • findBySKU

      @Transactional(readOnly=true) @GetMapping(value="/v1/products", params="sku") public org.springframework.http.ResponseEntity<ProductVO> findBySKU(@RequestParam("sku") String sku)
    • findByPKey

      @Transactional(readOnly=true) @GetMapping("/v1/products/{pKey}") public org.springframework.http.ResponseEntity<ProductVO> findByPKey(@PathVariable("pKey") String pKey)
    • findBySKUandUOM

      @Transactional(readOnly=true) @GetMapping(value="/v1/products", params={"sku","uom"}) public org.springframework.http.ResponseEntity<ProductVO> findBySKUandUOM(@RequestParam("sku") String sku, @RequestParam("uom") String uom)
    • findByLabelOrSKU

      @Transactional(readOnly=true) @GetMapping(value="/v1/products", params="bk") public org.springframework.http.ResponseEntity<ProductVO> findByLabelOrSKU(@RequestParam("bk") String bk)
    • create

      @Transactional @Validated @PostMapping("/v1/products") public org.springframework.http.ResponseEntity<Void> create(@NotNull @Size(min=1) @RequestBody @NotNull @Size(min=1) List<ProductVO> products, jakarta.servlet.http.HttpServletRequest req)
    • update

      @Transactional @Validated(UpdateProduct.class) @PutMapping("/v1/products") public org.springframework.http.ResponseEntity<ProductVO> update(@Valid @NotNull @RequestBody @Valid @NotNull ProductVO product)
    • delete

      @DeleteMapping("/v1/products/{pKey}") public org.springframework.http.ResponseEntity<Void> delete(@PathVariable("pKey") String pKey)