Class AllergyController
java.lang.Object
ntnu.idatt2016.v233.SmartMat.controller.product.AllergyController
Controller for allergies
- Author:
- Stian Lyng
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<List<AllergyResponse>>
Gets list of all allergies, without productsorg.springframework.http.ResponseEntity<Allergy>
getAllergyByName
(String name) Gets allergy by name, also includes products that contain the allergy
-
Constructor Details
-
AllergyController
public AllergyController()
-
-
Method Details
-
getAllergyByName
@GetMapping("/id/{name}") public org.springframework.http.ResponseEntity<Allergy> getAllergyByName(@PathVariable("name") String name) Gets allergy by name, also includes products that contain the allergy- Parameters:
name
- Name of allergy- Returns:
- Allergies including products that contain the allergy
-
getAllAllergies
@GetMapping("/all") public org.springframework.http.ResponseEntity<List<AllergyResponse>> getAllAllergies()Gets list of all allergies, without products- Returns:
- List of allergies, without products that contain the allergy
-