Class MaterialService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.materials.rs1.material.MaterialService
@RestController
@RequestMapping("inventory/materials/r1/materials")
@Resource(logging=true)
public class MaterialService
extends PrivateService
Services to manage materials.
- Since:
- 17.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<DTOMaterial> get(Long id, Collection<String> fields, String language) Retrieves the requiredDTOMaterialby calling from theMaterialLoadEvent.org.springframework.http.ResponseEntity<PageResponse<DTOMaterial>> getCollection(@Valid Page page, Collection<String> fields, String order, String language, @Valid DTOMaterialSearchFilter filter) Returns the collection of all the stored materials by calling theMaterialSearchEvent.org.springframework.http.ResponseEntity<Void> patch(Long id, @Valid DTOMaterialUpdate dto) Updates the required material by calling theMaterialUpdateEvent.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid DTOMaterialInsert dto) Creates a new material by calling theMaterialInsertEvent.
-
Constructor Details
-
MaterialService
public MaterialService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOMaterial>> getCollection(@RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @RequestParam(required=false,name="_language",defaultValue="user") String language, @Valid @Valid DTOMaterialSearchFilter filter) throws DAValidateException, DAException Returns the collection of all the stored materials by calling theMaterialSearchEvent.- Parameters:
page- thePagethat will contain the paginated resultfilter- theDTOMaterialSearchFilter- Returns:
- the collection of
DTOMaterial - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{materialId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOMaterial> get(@PathVariable("materialId") Long id, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_language",defaultValue="user") String language) throws DAValidateException, DAException Retrieves the requiredDTOMaterialby calling from theMaterialLoadEvent.- Parameters:
id- the material idlanguage- the currently needed language- Returns:
- the response containing the loaded
DTOMaterial - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
post
@PostMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid @RequestBody @Valid DTOMaterialInsert dto) throws DAValidateException, DAException Creates a new material by calling theMaterialInsertEvent.- Parameters:
dto- theDTOMaterialInsertcontaining the needed info- Returns:
- the response containing the id of the inserted material
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(value="{materialId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("materialId") Long id, @Valid @RequestBody @Valid DTOMaterialUpdate dto) throws DAValidateException, DAException Updates the required material by calling theMaterialUpdateEvent.- Parameters:
id- the material iddto- theDTOMaterialUpdatecontaining the needed info- Returns:
- the update response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-