use of br.fatecsp.engsoft.entities.Theme in project Projeto_Detetive_ES3 by VitorAndrioli.
the class CardService method register.
public Card register(Long themeId, CardRequest request) {
Card card = Card.toEntity(request);
Theme theme = themeService.find(themeId);
card.setTheme(theme);
return cardRepository.save(card);
}
use of br.fatecsp.engsoft.entities.Theme in project Projeto_Detetive_ES3 by VitorAndrioli.
the class ThemeService method register.
public Theme register(ThemeRequest request) {
Theme theme = Theme.toEntity(request);
themeRepository.save(theme);
return theme;
}
use of br.fatecsp.engsoft.entities.Theme in project Projeto_Detetive_ES3 by VitorAndrioli.
the class ThemeService method update.
public Theme update(Long id, ThemeRequest request) {
Theme theme = themeRepository.findOne(id);
theme.setName(request.getName());
theme.setPrice(request.getPrice());
theme.setImageSrc(request.getImageSrc());
themeRepository.save(theme);
return theme;
}
use of br.fatecsp.engsoft.entities.Theme in project Projeto_Detetive_ES3 by VitorAndrioli.
the class ThemeController method listAll.
@RequestMapping(method = RequestMethod.GET)
@PreAuthorize("hasAuthority('ADMIN')")
public ModelAndView listAll() {
ModelAndView model = new ModelAndView("themes");
List<Theme> themes = themeService.findAll();
model.addObject("themes", themes);
return model;
}
Aggregations