Class MaterialClassService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.materials.rs1.materialclass.MaterialClassService
@RestController
@RequestMapping("inventory/materials/r1/classes")
@Resource(logging=true)
public class MaterialClassService
extends PrivateService
Services to manage material class.
- Since:
- 17.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<DTOMaterialClass> get(Long id, Collection<String> fields, String language) Retrieves the requiredDTOMaterialClassby calling from theMaterialClassLoadEvent.org.springframework.http.ResponseEntity<PageResponse<DTOMaterialClass>> getCollection(@Valid Page page, Collection<String> fields, String order, String language, @Valid DTOMaterialClassSearchFilter filter) Returns the collection of all the stored material classes by calling theMaterialClassSearchEvent.org.springframework.http.ResponseEntity<Void> patch(Long id, @Valid DTOMaterialClassUpdate dto) Updates the required material by calling theMaterialClassUpdateEvent.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> Creates a new material class by calling theMaterialClassInsertEvent.
-
Constructor Details
-
MaterialClassService
public MaterialClassService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOMaterialClass>> 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 DTOMaterialClassSearchFilter filter) throws DAValidateException, DAException Returns the collection of all the stored material classes by calling theMaterialClassSearchEvent.- Parameters:
page- thePagethat will contain the paginated resultfilter- theDTOMaterialClassSearchFilter- Returns:
- the response containing the collection of
DTOMaterialClass - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{classId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOMaterialClass> get(@PathVariable("classId") Long id, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_language",defaultValue="user") String language) throws DAValidateException, DAException Retrieves the requiredDTOMaterialClassby calling from theMaterialClassLoadEvent.- Parameters:
id- the material class idlanguage- the currently needed language- Returns:
- the response containing the loaded
DTOMaterialClass - 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 DTOMaterialClassInsert dto) throws DAValidateException, DAException Creates a new material class by calling theMaterialClassInsertEvent.- Parameters:
dto- theDTOMaterialClassInsertcontaining the needed info- Returns:
- the response containing the id of the inserted material class
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(value="{classId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("classId") Long id, @Valid @RequestBody @Valid DTOMaterialClassUpdate dto) throws DAValidateException, DAException Updates the required material by calling theMaterialClassUpdateEvent.- Parameters:
id- the material class iddto- theDTOMaterialClassUpdatecontaining the needed info- Returns:
- the update response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-