| | |
| | | import de.gedoplan.seminar.sbt.di.exercise.service.BarInfo; |
| | | import de.gedoplan.seminar.sbt.di.exercise.service.CocktailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @Autowired |
| | | private List<Cocktail> cocktails; |
| | | |
| | | @Qualifier("alcoholic") |
| | | @Autowired |
| | | private List<Cocktail> cocktailsAlcoholic; |
| | | |
| | | @Qualifier("non-alcoholic") |
| | | @Autowired |
| | | private List<Cocktail> cocktailsNonAlcoholic; |
| | | |
| | | @GetMapping(path = "name", produces = MediaType.TEXT_PLAIN_VALUE) |
| | | public String getName() { |
| | | return barInfo.getBarName(); |
| | |
| | | |
| | | @GetMapping(path = "alc", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public List<Cocktail> getAlcoholicCocktails() { |
| | | return List.of(); |
| | | return cocktailsAlcoholic; |
| | | } |
| | | |
| | | @GetMapping(path = "nonalc", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public List<Cocktail> getNonAlcoholicCocktails() { |
| | | return List.of(); |
| | | return cocktailsNonAlcoholic; |
| | | } |
| | | } |