Package de.trustable.ca3s.core.web.rest
Class AlgorithmRestrictionResource
- java.lang.Object
-
- de.trustable.ca3s.core.web.rest.AlgorithmRestrictionResource
-
@RestController @RequestMapping("/api") public class AlgorithmRestrictionResource extends ObjectREST controller for managingAlgorithmRestriction.
-
-
Constructor Summary
Constructors Constructor Description AlgorithmRestrictionResource(AlgorithmRestrictionService algorithmRestrictionService, AlgorithmRestrictionRepository algorithmRestrictionRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<AlgorithmRestriction>createAlgorithmRestriction(@Valid AlgorithmRestriction algorithmRestriction)POST /algorithm-restrictions: Create a new algorithmRestriction.org.springframework.http.ResponseEntity<Void>deleteAlgorithmRestriction(Long id)DELETE /algorithm-restrictions/:id: delete the "id" algorithmRestriction.org.springframework.http.ResponseEntity<AlgorithmRestriction>getAlgorithmRestriction(Long id)GET /algorithm-restrictions/:id: get the "id" algorithmRestriction.List<AlgorithmRestriction>getAllAlgorithmRestrictions()GET /algorithm-restrictions: get all the algorithmRestrictions.org.springframework.http.ResponseEntity<AlgorithmRestriction>updateAlgorithmRestriction(Long id, @Valid AlgorithmRestriction algorithmRestriction)PUT /algorithm-restrictions/:id: Updates an existing algorithmRestriction.
-
-
-
Constructor Detail
-
AlgorithmRestrictionResource
public AlgorithmRestrictionResource(AlgorithmRestrictionService algorithmRestrictionService, AlgorithmRestrictionRepository algorithmRestrictionRepository)
-
-
Method Detail
-
createAlgorithmRestriction
@PostMapping("/algorithm-restrictions") @PreAuthorize("hasRole(\"ROLE_ADMIN\")") public org.springframework.http.ResponseEntity<AlgorithmRestriction> createAlgorithmRestriction(@Valid @RequestBody @Valid AlgorithmRestriction algorithmRestriction) throws URISyntaxExceptionPOST /algorithm-restrictions: Create a new algorithmRestriction.- Parameters:
algorithmRestriction- the algorithmRestriction to create.- Returns:
- the
ResponseEntitywith status201 (Created)and with body the new algorithmRestriction, or with status400 (Bad Request)if the algorithmRestriction has already an ID. - Throws:
URISyntaxException- if the Location URI syntax is incorrect.
-
updateAlgorithmRestriction
@PutMapping("/algorithm-restrictions/{id}") @PreAuthorize("hasRole(\"ROLE_ADMIN\")") public org.springframework.http.ResponseEntity<AlgorithmRestriction> updateAlgorithmRestriction(@PathVariable(value="id",required=false) Long id, @Valid @RequestBody @Valid AlgorithmRestriction algorithmRestriction) throws URISyntaxExceptionPUT /algorithm-restrictions/:id: Updates an existing algorithmRestriction.- Parameters:
id- the id of the algorithmRestriction to save.algorithmRestriction- the algorithmRestriction to update.- Returns:
- the
ResponseEntitywith status200 (OK)and with body the updated algorithmRestriction, or with status400 (Bad Request)if the algorithmRestriction is not valid, or with status500 (Internal Server Error)if the algorithmRestriction couldn't be updated. - Throws:
URISyntaxException- if the Location URI syntax is incorrect.
-
getAllAlgorithmRestrictions
@GetMapping("/algorithm-restrictions") @PreAuthorize("hasRole(\"ROLE_ADMIN\")") public List<AlgorithmRestriction> getAllAlgorithmRestrictions()GET /algorithm-restrictions: get all the algorithmRestrictions.- Returns:
- the
ResponseEntitywith status200 (OK)and the list of algorithmRestrictions in body.
-
getAlgorithmRestriction
@GetMapping("/algorithm-restrictions/{id}") @PreAuthorize("hasRole(\"ROLE_ADMIN\")") public org.springframework.http.ResponseEntity<AlgorithmRestriction> getAlgorithmRestriction(@PathVariable Long id)GET /algorithm-restrictions/:id: get the "id" algorithmRestriction.- Parameters:
id- the id of the algorithmRestriction to retrieve.- Returns:
- the
ResponseEntitywith status200 (OK)and with body the algorithmRestriction, or with status404 (Not Found).
-
deleteAlgorithmRestriction
@DeleteMapping("/algorithm-restrictions/{id}") @PreAuthorize("hasRole(\"ROLE_ADMIN\")") public org.springframework.http.ResponseEntity<Void> deleteAlgorithmRestriction(@PathVariable Long id)DELETE /algorithm-restrictions/:id: delete the "id" algorithmRestriction.- Parameters:
id- the id of the algorithmRestriction to delete.- Returns:
- the
ResponseEntitywith status204 (NO_CONTENT).
-
-