use of com.viadee.sonarQuest.entities.Level in project sonarQuest by viadee.
the class LevelController method updateLevel.
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public Level updateLevel(@PathVariable(value = "id") Long id, @RequestBody LevelDto levelDto) {
Level level = this.levelRepository.findById(id);
if (level != null) {
level.setName(levelDto.getName());
level.setMin(levelDto.getMin());
level.setMax(levelDto.getMax());
level = this.levelRepository.save(level);
}
return level;
}
use of com.viadee.sonarQuest.entities.Level in project sonarQuest by viadee.
the class DeveloperService method createDeveloper.
public Developer createDeveloper(DeveloperDto developerDto) {
Developer developer;
if (this.checkIfUsernameNotExists(developerDto)) {
Level level1 = this.levelRepository.findById((long) 1);
developer = this.developerRepository.save(new Developer(developerDto.getUsername(), (long) 0, (long) 0, level1, developerDto.getPicture(), developerDto.getAboutMe(), developerDto.getAvatarClass(), developerDto.getAvatarRace(), developerDto.getArtefacts(), developerDto.getAdventures(), developerDto.getParticipations()));
} else {
developer = null;
}
return developer;
}