Class AllergyController

java.lang.Object
ntnu.idatt2016.v233.SmartMat.controller.product.AllergyController

@RestController @RequestMapping("/api/allergies") public class AllergyController extends Object
Controller for allergies
Author:
Stian Lyng
  • 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